CHADstack icon indicating copy to clipboard operation
CHADstack copied to clipboard

Seriously

Open RidaEn-nasry opened this issue 2 years ago • 8 comments

RidaEn-nasry avatar Feb 24 '23 21:02 RidaEn-nasry

Prime is becoming a cobalt dev, rust was just too easy

imMatheus avatar Feb 24 '23 23:02 imMatheus

import Control.Concurrent (threadDelay)
import Control.Monad (when)
import Data.List (permutations)
import Network.AWS.DynamoDB
import Network.AWS.Data.Text (toText)
import System.Environment (getEnv)
import Database.MySQL.Simple

waitUntilReady :: IO ()
waitUntilReady = do
  ready <- checkIfWordIsReady
  when (not ready) $ do
    threadDelay 1000000
    waitUntilReady

checkIfWordIsReady :: IO Bool
checkIfWordIsReady = do
  let allWords = permutations "seriously"
  host <- getEnv "DB_HOST"
  port <- read <$> getEnv "DB_PORT"
  user <- getEnv "DB_USER"
  password <- getEnv "DB_PASSWORD"
  database <- getEnv "DB_NAME"
  conn <- connect defaultConnectInfo
    { connectHost = host
    , connectPort = port
    , connectUser = user
    , connectPassword = password
    , connectDatabase = database
    }
  result <- query conn "SELECT COUNT(*) FROM words WHERE word IN ?" (Only allWords)
  let count = fromOnly (head (head result))
  close conn
  return (count > 0)

saveToDynamoDB :: IO ()
saveToDynamoDB = do
  let item = toText "message" .= toText "YOU ARE A CHAD"
  env <- newEnv Discover
  tableName <- getEnv "TABLE_NAME"
  let req = putItem (toText tableName) & piItem .~ item
  void $ runResourceT $ runAWS env $ send req

main :: IO ()
main = do
  waitUntilReady
  saveToDynamoDB
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Chadness</title>
  <script src="https://cdn.jsdelivr.net/npm/alpinejs@3"></script>
  <script src="https://sdk.amazonaws.com/js/aws-sdk-2.892.0.min.js"></script>
  <style>
    body {
      background-image: url('https://i.ytimg.com/vi/eUitWjpCZY4/maxresdefault.jpg?sqp=-oaymwEmCIAKENAF8quKqQMa8AEB-AH-CYAC0AWKAgwIABABGF4gXiheMA8=&rs=AOn4CLASMJCXS3yeCssfuxtlZ6acGCHpHA');
      background-size: cover;
      color: white;
      font-family: sans-serif;
    }

    .container {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100vh;
    }

    .message {
      font-size: 4rem;
      font-weight: bold;
      margin-bottom: 2rem;
      text-shadow: 2px 2px 0 black;
    }

    .link {
      font-size: 2rem;
      text-decoration: none;
      color: white;
      text-shadow: 1px 1px 0 black;
    }

    .link:hover {
      text-decoration: underline;
    }
  </style>
</head>
<body>
  <div x-data="{
    message: 'Loading...',
    link: 'https://www.youtube.com/@ThePrimeagen',
    loadMessage: function() {
      var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
      var params = {
        TableName: 'chadness',
        Key: {
          'id': {S: 'message'},
        },
      };
      dynamodb.getItem(params, function(err, data) {
        if (err) {
          console.log(err);
          this.message = 'YOU ARE A JavaScript DEV';
          this.link = 'https://www.youtube.com/@t3dotgg';
        } else {
          console.log(data);
          if (data.Item && data.Item.message && data.Item.message.S) {
            this.message = data.Item.message.S;
          } else {
            this.message = 'YOU ARE A JavaScript DEV';
            this.link = 'https://www.youtube.com/@t3dotgg';
          }
        }
      }.bind(this));
    },
  }" x-init="loadMessage()">
    <div class="container">
      <div class="message" x-text="message"></div>
      <a class="link" x-bind:href="link">Go to channel</a>
    </div>
  </div>
</body>
</html>

^ this was generated by ChatGPT

marcelarie avatar Feb 24 '23 23:02 marcelarie

CHADStack nvim.lua >= 5mb rewrote arch linux kernel in rust.

the natural progression was obviously COBOL, Haskell, AlpineJS and Docker. (had to edit the stack when I realized he was serious)

else gtfo go back to PythonScript or whatever inferior languages simpletons use these days

PThorpe92 avatar Feb 25 '23 01:02 PThorpe92

Such a chad move leaving the repo empty.

jmiller-rise8 avatar Feb 26 '23 01:02 jmiller-rise8

I contemplate the notion that at times, the vacuity and stillness we encounter embody the essence of our being, reaching beyond mere human existence. This void, as manifested by the empty repository, prompts me to ruminate on its significance. @ThePrimeagen, a brilliant mind, imparts a wealth of wisdom that enriches our understanding of the world.

vmnog avatar Mar 01 '23 16:03 vmnog

Aha, so I'm not the only idiot in the world, who would write an entire http server with blackjack and gurlz completely from scratch, just bc I was bored

maddsua avatar Mar 03 '23 13:03 maddsua

No really, came here from YouTube. What the heck is this?

maddsua avatar Mar 03 '23 13:03 maddsua

the repo is not empty the repo is not up-to-date

LIVE COBOL LOVE COBOL

ThePrimeagen avatar Mar 03 '23 16:03 ThePrimeagen