Skip to content

Instantly share code, notes, and snippets.

View BinRoot's full-sized avatar

Nishant Shukla BinRoot

View GitHub Profile
@BinRoot
BinRoot / emptiness.quote
Created September 3, 2014 06:24
Emptiness
Knowing that mentality,
taking straightforwardness as basic,
taking the real mind as the Way,
practicing martial arts in the broadest sense,
thinking correctly, clearly, and comprehensively,
taking emptiness as the Way,
you see the Way as emptiness.
In emptiness there is good but no evil.
Wisdom exists, logic exists, the Way exists, mind is empty.
import System.Random (getStdGen, randomR)
import Data.MultiSet (fromList, toOccurList)
import Data.List (maximum)
import Data.Function (on)
import Data.List (sortBy)
import Graphics.Google.Chart
import Hledger.Cli.Utils (openBrowserOn)
step xs g = (newItem : xs, newG)
where (i, newG) = pick (length xs) g
But even if TextMate 2 drops from the sky fully-formed and marveled
at by all, Emacs will still be there, waiting. It will be there when
the icecaps melt and the cities drown, when humanity destroys itself
in fire and zombies, when the roaches finally achieve sentience, take
over, and begin using computers themselves — at which point its
various Ctrl-Meta key-chords will seem not merely satisfyingly
ergonomic for the typical arthropod, but also direct evidence for the
universe’s Intelligent Design by some six-legged, multi-jointed
God.
<html>
<body>
<script>
var d = new Date()
var date = d.getDate()
if ( date > 20 ) {
alert("the month is almost over")
}
<html>
<body>
<script>
var str = "the quick brown fox"
var french = str.replace("the", "le")
alert(french)
</script>
</body>
<html>
<body>
<script>
var person = prompt("What's your name?","Grace Hopper");
if ( person!=null ) {
x = "Hi " + person + "!";
alert( x );
}
</script>
var person = prompt("Your name?");
if ( person!=null ) {
x = "Hi " + person + "!";
alert( x );
}
@BinRoot
BinRoot / test.c
Created February 12, 2014 18:29
app_fill esp.aplx all 1-16 16
/*
* This simulation demos using the routing table to send packets between chips.
* The NW, SE, and SW chips are all sending a packet to every core on the NE chip.
* On receiving a packet, the core simply prints an acknowledgement.
*/
#include "spin1_api.h"
#define NORTH 3
#define SOUTH 2
@BinRoot
BinRoot / download.sh
Last active January 1, 2016 14:19
Haskell implementation of Norvig's simplified algorithm to autocorrect a spelling mistake
#!/bin/bash
# download the code
wget https://gist.github.com/BinRoot/8157165/raw/9109a51173b76c4e233fd00165fb25e62b249aa5/spell.hs
# download big.txt
wget http://norvig.com/big.txt
# run the code
runhaskell spell
@BinRoot
BinRoot / xmonad.hs
Created December 28, 2013 00:45
My current xmonad config. Made with love.
-- Author: BinRoot
-- Todo: dmenu, animations
import XMonad
import XMonad.Config.Gnome
import XMonad.Layout.NoBorders (smartBorders)
import XMonad.Hooks.FadeInactive (fadeInactiveLogHook)
import XMonad.Hooks.ManageDocks (manageDocks)
import XMonad.Hooks.SetWMName (setWMName)
import XMonad.Layout.Spacing (smartSpacing)