Skip to content

Instantly share code, notes, and snippets.

View moizjv's full-sized avatar
🎯
Focusing

Moiz Virani moizjv

🎯
Focusing
View GitHub Profile
@moizjv
moizjv / gist:3a9ab07a5211b9fab32e
Created July 28, 2015 00:50
deleting existing iOS simulators based on iOS version
xcrun simctl list devices | sed -n '/-- iOS 7.1/,/--/p'| grep -v '^[-=]' | cut -d "(" -f2 | cut -d ")" -f1 | xargs -I {} xcrun simctl delete "{}"
@moizjv
moizjv / git_Cheat_sheet.sh
Created July 21, 2015 06:57
pushing to upstream from different branch
git push upstream local-name:remote-name
const Y = (f) => {
const g = (h) => {
return (x) => {
return f(h(h))(x);
};
};
return g(g);
};
const Y = (fn) => {
return (x) => {
return fn(Y(fn))(x);
};
};
@moizjv
moizjv / gist:eff695e314fda0b40daf
Created July 5, 2015 21:14
Y combinator factorial function
const fac = (recurse) => {
return function(x) {
return x === 0 ? 1 : x * recurse(x-1);
};
};
@moizjv
moizjv / gist:4c7fb1b6b39005b086be
Created May 20, 2014 06:16
parallel file reads in haskell
readFilesFromDirectory :: IO [([Char], [([Char], Int)])]
readFilesFromDirectory = do
allFiles <- getDirectoryContents "docs"
let filtered = filter (endswith ".htm") allFiles
--listOfTuplesWithFileContent <- readingFiles filtered
listOfTuplesWithFileContent <- combingReadFiles $ readingFilesInParallel filtered
return listOfTuplesWithFileContent
stripTags :: String -> String
@moizjv
moizjv / ghc 7.8.1 in ubuntu 12.10
Created April 9, 2014 06:25
To install ghc 7.8.1 on ubuntu 12.10 LTS
Add this ppa other ones dint work from me
sudo apt-add-repository "deb http://ppa.launchpad.net/hvr/ghc/ubuntu precise main"
sudo apt-update
sudo apt-get install ghc-7.8.1
export PATH=/opt/ghc/7.8.1/bin:$PATH