This file contains 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
# fzf gcloud | |
function fzf-gconf() { | |
local proj=$(gcloud config configurations list | grep -v NAME | fzf --query "$LBUFFER") | |
if [ -n "$proj" ]; then | |
local cnf=$(echo ${proj} | awk '{print $1;}') | |
BUFFER="gcloud config configurations activate ${cnf}" | |
zle accept-line | |
fi | |
zle reset-prompt | |
} |
This file contains 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
import math; print map(lambda m: int(math.log(m, 2)), map(lambda n : int(n), raw_input().split())) |
This file contains 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
years=25 | |
amount = 45000000 | |
bonus=300000 | |
yearlyPay= 120000 | |
def yearPay(): | |
pay = 0 | |
pay += bonus * 2 | |
pay += yearlyPay * 12 |
This file contains 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
import pycassa; | |
import time; | |
pool = pycassa.ConnectionPool('keyspace') | |
cf = pycassa.ColumnFamily(pool, 'columnfamily') | |
rowKey = "row" | |
print cf.get(rowKey) | |
cf.insert(rowKey, {"detail_info":"future"}, time.time()*1000) | |
print cf.get(rowKey) |
This file contains 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
➜ stack cat main.go | |
package stack | |
type stack struct { | |
head int | |
values []int | |
} | |
type Stack interface { | |
Push(int) | |
Pop() int |