Skip to content

Instantly share code, notes, and snippets.

View BinRoot's full-sized avatar

Nishant Shukla BinRoot

View GitHub Profile
import Data.List
main = do
print "hi"
list1 = ["aa", "bb", "cc"]
list2 = ["bb", "cc"]
getMatches list1 list2 = getMatches' (check list1 list2) list2
getMatches' indices list2 = map (f list2) (filter (>=0) indices)
@BinRoot
BinRoot / systemd.quote
Last active December 16, 2015 06:19
Arch Systemd
We make Arch for ourselves, and for the ones that like it like we do.
Whether we have a million users or one hundred users –
we will keep making it the distro we like.
Deal with it.
- Brain0
@BinRoot
BinRoot / davidhu.js
Last active December 15, 2015 12:19
Nice RegEx, Bro
if(/^([a-z]([a-z]|\d|\+|-|\.)*):(\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])
|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?((\[(|(v[\da-f]{1,}\.(([a-z]|\d|-|\.|_|~)|[!\$&'\(\)\*\+,;=]|
:)+))\])|((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\
d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-
\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=])*)(:\d*)?)(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF
\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*|(\/((([a-z]|\d|-|\.|_|~|[\u00A0-
\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-
\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)|((([a-z]|\d|-|\.|_|~|[
\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~
|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)|((([a-z]|\d|-|\.
...the hammer that strikes the nail, not the carpenter who wields it.
- Psychology Textbook
@BinRoot
BinRoot / hole.quote
Last active December 15, 2015 05:39
Genius of the Hole
The genius of the hole:
no matter how long you spend climbing out,
you can still fall back down in an instant.
- Max Payne
@BinRoot
BinRoot / xmonad.hs
Created March 13, 2013 00:45
My XMonad config
import XMonad
import XMonad.Config.Gnome
import XMonad.Util.EZConfig
import XMonad.Util.Run
import XMonad.Prompt.Workspace
import qualified XMonad.StackSet as S
main = xmonad $ gnomeConfig
{
modMask = mod4Mask -- win key for mod
@BinRoot
BinRoot / death.quote
Last active December 14, 2015 19:59
Three Deaths
There are three deaths.
The first is when the body ceases to function.
The second is when the body is consigned to the grave.
The third is that moment, sometime in the future,
when your name is spoken for the last time.
- Eagleman, "Sum: Forty Tales from the Afterlives"
@BinRoot
BinRoot / scientific-theories.quote
Created March 12, 2013 05:40
Scientific Theories
Besides, we do not prefer every non-falsified theory -
only one which, in the light of criticism,
appears to be better than its competitors:
which solves our problems, which is well tested,
and of which we think, or rather conjecture or hope
(considering other provisionally accepted theories),
that it will stand up to further tests.
- Popper's "Conjectures and Refutations"
@BinRoot
BinRoot / tree.hs
Created February 19, 2013 04:43
Haskell Trees by James C. Sun
-- Mastered by James C. Sun
module BinaryTree
(Tree(..), makeTree, add, printTree)
where
data Tree = Tree Int Tree Tree | EMPTYTREE deriving (Show, Eq)
printTree :: Tree -> IO()
printTree tree = putStrLn (printSubTree tree 0 0)
@BinRoot
BinRoot / MyData.hs
Created February 12, 2013 16:52
Haskell code used in Lecture 5 from http://shuklan.com/haskell/lec05.html
module MyData
(MetricUnit(..),
ImperialUnit(..),
Measurement(..),
convert)
where
data MetricUnit = Meter
| Liter