Skip to content

Instantly share code, notes, and snippets.

@L8D
L8D / bf.sh
Last active Jan 3, 2016
Script to compose optimize.hs, compile.hs and GCC.
View bf.sh
#!/usr/bin/env bash
cat $1 | ./compile | gcc --std=c99 -x c -o $2 -
@L8D
L8D / hi.bf
Last active Jan 3, 2016
Output: "hi\n"
View hi.bf
+++++ +++++ [ > +++++ +++++ > + << - ] > ++++ . + . > .
@L8D
L8D / test.js
Last active Jan 4, 2016 — forked from oroce/test.js
View test.js
var gimmeFullscreenMethod = function() {
'use strict';
var el = document.documentElement, open, cancel, video;
open = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;
cancel = el.exitFullscreen || el.webkitExitFullscreen || el.mozExitFullscreen || el.msExitFullscreen;
if (open) {
return {
@L8D
L8D / cat.hs
Last active Aug 29, 2015 — forked from Siim/cat.hs
View cat.hs
import System.Environment (getArgs)
main = do
args <- getArgs
if null args then interact id else mapM ((>>= putStr) . readFile) args
View fizzbuzz.hs
main = putStr . unlines . map fizzbuzz $ [1..100]
divBy = ((== 0) .) . mod
fizzbuzz :: Int -> String
fizzbuzz x | x `divBy` 15 = "FizzBuzz"
| x `divBy` 5 = "Buzz"
| x `divBy` 3 = "Fizz"
| otherwise = show x
View gist:8980539
test :: Num a => [a] -> [a]
test = filter $ (== 0) . (`mod` 2)
View weird-adder.hs
-- weird-adder.hs - Josh Sandlin - 6:45PM - 2/14/2010
-- wierd-adder.hs - Tenor Biel - 12:09PM - 2/13/201
-- Really weird way to add a range of numbers
-- takes an upper limit and returns a list of pairs
pairedRange :: Int -> [(Int, Int)]
pairedRange x = zip (filter odd [1..x]) (filter even [1..x])
-- adds a list of pairs
addPairs :: Num a => [(a, a)] -> [a]
@L8D
L8D / code-sourcer.hs
Created Mar 7, 2014
MTG Picture-sourcer for untap.in
View code-sourcer.hs
parseLine = fmap tail . break (== ' ')
editLine = fmap f where
f s = s ++ "^http://mtgimage.com/card/" ++ s ++ ".jpg"
writeLine (x, y) = x ++ " " ++ y
main = interact $ unlines
. map ( writeLine
. editLine
@L8D
L8D / gist:7911fbaf0ad1b5642cd5
Last active Aug 29, 2015
Some MTG rules-enforced environment simulator concept prototypes
View gist:7911fbaf0ad1b5642cd5
import qualified Data.Set as S
data Color
= White
| Blue
| Black
| Red
| Green
deriving (Enum, Eq, Ord)
View vimrc
" setup NERDTree button
nnoremap <silent> <leader>m :NERDTreeToggle<enter>
" map ctrl+hjkl to c-w movements
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" pathogen stuff
You can’t perform that action at this time.