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 ruby | |
# coding: utf-8 | |
# "ALTKOO"を並び替えます。 | |
word = "ALTKOO" | |
carray = word.split(//) | |
carray.permutation.to_a.each do |elem| | |
p elem.join("") | |
end |
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
// | |
// YODDLog.h | |
// CocoaLumberjack Configuration | |
// | |
// Created by Ohashi Yusuke on 1/2/15. | |
// Copyright (c) 2015 Ohashi Yusuke. All rights reserved. | |
// | |
#ifndef _RSLogger_h | |
#define _RSLogger_h |
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 |
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
#!/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
// 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
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
#! /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
#!/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
#! /usr/bin/env python | |
import sys | |
args = sys.argv | |
f = open("test.txt",'r+') | |
s = args[1]+"\n" | |
for l in f: |