print password_hash("password", PASSWORD_DEFAULT);
$2y$10$sD6M3QtiI/CGm.AOjJkyVOhH4JSM1fDFRytJv5wvkXoXmIFxT8ANS
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
{ | |
init: function(elevators, floors) { | |
_.each(elevators, function(elevator) { | |
elevator.on("idle", function() { | |
_.each(floors, function(floor) { | |
floor.on("up_button_pressed", function() { | |
elevator.goToFloor(floor.level); | |
}); | |
floor.on("down_button_pressed", function() { | |
elevator.goToFloor(floor.level); |
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/sh | |
if [ $1 -lt $2 ]; then | |
m=$1;n=$2 | |
else | |
m=$2;n=$1 | |
fi | |
while [ $n -gt 0 ] | |
do | |
r=$(($m%$n)); m=$n; n=$r |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:GetBucketLocation", | |
"s3:ListAllMyBuckets" | |
], | |
"Resource": "arn:aws:s3:::*" |
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
import os | |
import sys | |
builtin = ['cd', 'exit'] | |
def execCd(cmd): | |
dir = cmd[3:] | |
try: | |
os.chdir(dir) | |
except: |
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
import os | |
import argparse | |
import datetime | |
parser = argparse.ArgumentParser() | |
parser.add_argument('dir', nargs='?', default=".") | |
parser.add_argument('-a', dest="all", default=False, action="store_true") | |
parser.add_argument('-l', dest="list", default=False, action="store_true") | |
parser.add_argument('-i', dest="inode", default=False, action="store_true") |
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
import sys | |
if len(sys.argv) > 1: | |
try: | |
f = open(sys.argv[1], "rU") | |
except IOError: | |
print "File" + sys.argv[1] + "not found" | |
sys.exit(1) | |
else: | |
f = sys.stdin |
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
def fb(i): | |
# http://python.rdy.jp/wiki.cgi?page=FizzBuzz | |
i -= 1 | |
return i%3/2*"Fizz" + i%5/4*"Buzz" | |
i = 1 | |
while i <=20: | |
print i, fb(i) | |
i = i + 1 |