Skip to content

Instantly share code, notes, and snippets.

@Treeki
Treeki / TurnipPrices.cpp
Last active May 27, 2024 15:18
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{
@mrkgnao
mrkgnao / TopSites.hs
Created February 19, 2018 16:19
What hosts do you visit most often in Firefox?
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Main where
import Protolude hiding ((:*:), optional)
import Database.Selda
@aaronlevin
aaronlevin / minimal-http.hs
Last active June 27, 2017 16:37
Minimal Haskell HTTP server written on top of warp via the Web Application Interface (no frameworks)
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.Wai (pathInfo, Request, requestMethod, Response, responseLBS, ResponseReceived)
import Network.Wai.Handler.Warp (run)
import Network.HTTP.Types (status200, status401)
-- note: type Application = Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived
application :: Request -> (Response -> IO ResponseReceived) -> IO ResponseReceived

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@jacobstanley
jacobstanley / ec2.md
Last active December 1, 2016 23:47
EC2 Instances

Ordered by vCPU

Instance Type vCPU Memory (GiB) Storage (GB) SSD Drives Network Perf. Processor Clock (GHz) AVX AVX2 Turbo EBS Opt. Enhanced Network
t1.micro 1 0.613 - - EBS Only Very Low ? ? - - - - -
t2.nano 1 0.5 - - EBS Only Low Intel Xeon family Up to 3.3 Yes - Yes - -
t2.micro 1 1 - - EBS Only Low to Moderate Intel Xeon family Up to 3.3 Yes - Yes - -
m1.small 1 1.7 160 - 1 x 160 Low ?
@queertypes
queertypes / FreeCoFree.hs
Created June 5, 2015 17:11
Exploring Free Monads, Cofree Comonads, and Pairings: DSLs and Interpreters
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-
Explores Free Monads (DSLs) and Cofree Comonads (interpreters) and
their relationship.
Most of the code in this file comes from (1) below. Only minor
modifications are made - semantics are preserved.
@lucamolteni
lucamolteni / gist:67004d88bf6a1ed88e2e
Last active August 29, 2015 14:11
Ancient vs Modern Programming
http://www.codewars.com/kata/51c8991dee245d7ddf00000e/solutions/javascript
"Complete the solution so that it reverses all of the words within the string passed in."
function reverseWords(str){
//split it into words, store in array
var words = str.split(" ")
var output = "";
//reverse the array and concat each word with space
for(var i = words.length-1; i >= 0; i--){
@Forkk
Forkk / Gloss.hs
Last active August 29, 2015 13:56
import Graphics.Gloss
import Hypercubes
import PVector
import qualified Data.Vector as DVector
import GHC.Float
import Data.Fixed
@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
Trolling #haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now