This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import sys | |
from datetime import datetime | |
arguments = sys.argv | |
arg_date = arguments[1] | |
bd = datetime.strptime(arg_date, "%Y%m%d") | |
now = datetime.now() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib | |
import sys | |
import os | |
import subprocess | |
import re | |
seed = sys.argv |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import sys | |
args = sys.argv | |
f = open("test.txt",'r+') | |
s = args[1]+"\n" | |
for l in f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# multiply numbers between 1..30, and answer number of zeros of the tail. | |
num = 1 | |
count = 0 | |
for i in range(1,31): | |
num *= i | |
while num % 10 == 0: | |
num /= 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# http://stackoverflow.com/questions/7244321/how-to-update-github-forked-repository | |
git fetch upstream | |
git checkout master | |
git rebase upstream/master | |
git push -f origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
animals = [ | |
'dog', | |
'cat', | |
'elephant'] | |
console.log animals |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// no transforms applied to window in iOS 8 | |
BOOL ignoreOrientation = [[NSProcessInfo processInfo] respondsToSelector:@selector(operatingSystemVersion)]; | |
if(!ignoreOrientation && UIInterfaceOrientationIsLandscape(orientation)) { | |
//iOS8 landscape | |
}else if(UIInterfaceOrientationIsLandscape(orientation)) { | |
//~iOS7 landscape | |
}else { | |
// portrate | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
XCTestCaseFormat = """// | |
// {ClassName}.m | |
// NrKj_iPhone | |
// | |
// Created by {Author} on {Date}. | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun fizzbuzz (n) | |
(cond | |
((= (% n 15) 0) "FizzBuzz") | |
((= (% n 5) 0) "Buzz") | |
((= (% n 3) 0) "Fizz") | |
(t n))) ; => fizzbuzz | |
(fizzbuzz 10) ; => "Buzz" | |
(fizzbuzz 2) ; => 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew list | sed -e 's/^/brew install /g' | awk '{print $1 " " $2 " " $3}' > homebrew.sh |