ThePrimeagen / CHADstack

MIT License
261 stars 6 forks source link

Seriously #2

Open RidaEn-nasry opened 1 year ago

imMatheus commented 1 year ago

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

marcelarie commented 1 year ago
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

PThorpe92 commented 1 year ago

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

jmiller-rise8 commented 1 year ago

Such a chad move leaving the repo empty.

vmnog commented 1 year ago

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.

maddsua commented 1 year ago

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 commented 1 year ago

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

ThePrimeagen commented 1 year ago

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

LIVE COBOL LOVE COBOL