Skip to content

Instantly share code, notes, and snippets.

View KirinDave's full-sized avatar

Dave Fayram KirinDave

View GitHub Profile
@KirinDave
KirinDave / chef_env.hs
Created November 2, 2011 22:46
A quick script to read my knife file (if it exists) and output some data for my zshrc
import System.IO
import System.Environment
import Data.List
import Data.Maybe
import Control.Applicative
import HSH
isQuote x = x == '"' || x == '\''
isntQuote = not . isQuote
lineWith = find . isInfixOf
main = do
xmonad $ ewmh $ defaultConfig
{ manageHook = manageDocks <+>
manageHook defaultConfig <+>
-- ...
namedScratchpadManageHook sessionScratchpads
, layoutHook = avoidStruts $ smartBorders myLayoutHook
, logHook = dynamicLog >> updatePointer (Relative 0.1 0.05)
, modMask = modMaskKey
halp :: Int -> IO [Int]
halp 0 = return []
halp a = do
putStrLn "Tick in IO [Int]"
y <- halp (a - 1)
return $ 1 : y
halphalp :: Int -> [IO Int]
halphalp n = replicate n $ (putStrLn "Tick in [IO Int]" >> return 1)
// Initializing variables
var action = "enter";
var location = {
name: "CrowdFlower",
latitude: "37.00000",
longitude: "-122.00000"
};
console.log("Setting up campfire chatter.");
@KirinDave
KirinDave / troll.txt
Created June 16, 2012 17:49
An elegant attempt to troll #haskell
[10:48am] singpolyma joined the chat room.
[10:48am] singpolyma:https://github.com/ericmoritz/wsdemo/blob/results-v1/results.md
[10:48am] singpolyma left the chat room.
@KirinDave
KirinDave / popquiz.clj
Created June 19, 2012 18:22
Pop quiz, spot the clojure bug
(defn normalize-json-args [map]
(letfn [(keyify [s] (keyword (string/replace s "_" "-")))
(cleaner [[k v]] (if (string? k) [(keyify k) v] [k v]))
(walker [x] (if (map? x) (into {} (map cleaner x)) x))]
(postwalk walker map)))
@KirinDave
KirinDave / Helpers_SassCompiler.hs
Created September 24, 2012 06:34
Rewritten sass helper for hakyll.
{-# LANGUAGE OverloadedStrings, QuasiQuotes #-}
module Helpers.SassCompiler (compressSassCompiler, sassCompiler) where
import qualified Data.ByteString.Char8 as B
import Control.Arrow ((>>>))
import Data.Conduit
import Data.Conduit.Process
import System.Process.QQ
import Data.Conduit.List (consume)
class FizzBuzz
def initialize
@printed = nil
@printers = [ lambda {|x| print (@printed = "Fizz") if x % 3 == 0},
lambda {|x| print (@printed = "Buzz") if x % 5 == 0},
lambda {|x| print (@printed = "Bazz") if x % 7 == 0} ]
end
def for_num(i)
@KirinDave
KirinDave / gist:5749499
Created June 10, 2013 15:08
Looks like an issue in Xeno w/ latest forge.
java.lang.NoSuchMethodError: xreliquary.items.ItemCondensedPotion.func_77636_d(Lnet/minecraft/item/ItemStack;)Z
at xreliquary.items.ItemCondensedPotion.func_77659_a(ItemCondensedPotion.java:635)
at net.minecraft.item.ItemStack.func_77957_a(ItemStack.java:173)
at net.minecraft.item.ItemInWorldManager.func_73085_a(ItemInWorldManager.java:349)
at net.minecraft.network.NetServerHandler.func_72472_a(NetServerHandler.java:539)
at net.minecraft.network.packet.Packet15Place.func_73279_a(SourceFile:58)
at net.minecraft.network.TcpConnection.func_74428_b(TcpConnection.java:461)
at net.minecraft.network.NetServerHandler.func_72570_d(NetServerHandler.java:134)
at net.minecraft.network.NetworkListenThread.func_71747_b(NetworkListenThread.java:53)
at net.minecraft.server.dedicated.DedicatedServerListenThread.func_71747_b(SourceFile:30)
@KirinDave
KirinDave / gist:6117117
Last active December 20, 2015 10:39 — forked from danryan/gist:6116878
HTTP/1.1 200 OK
Server: Turtle
Content-Type: application/turtles; charset=turtles
{
"turtles": {
"turtles": {
"turtles": {
"turtles": {
"turtles": {
"turtles": {