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
from sys import argv, exit | |
from random import choice | |
from string import ascii_letters, digits | |
if len(argv) < 2: | |
print "usage: %s length [quantity]" % (argv[0]) | |
exit(1) | |
length, quantity = int(argv[1]), 1 | |
if len(argv) == 3: |
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
jQuery.cleanData = _.wrap jQuery.cleanData, (cleanData, elems) -> | |
for elem in elems | |
$(elem).data('view')?.dispose() | |
cleanData.apply @, arguments |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 Data.List | |
import Data.Tree | |
combinationsTree xs = unfoldTree next ([], xs) | |
where next (path, xs) = (path, map (appendTo path . splitAt 1) $ init $ tails xs) | |
appendTo path (x, ys) = (path ++ x, ys) | |
depth 0 node = Node{rootLabel=(rootLabel node), subForest=[]} | |
depth n node = node{subForest=(map (depth (n - 1)) (subForest node))} |
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
pyg = 'ay' | |
original = raw_input('Enter a word:') | |
if len(original) > 0 and original.isalpha(): | |
word = original.lower() | |
first = word[0] | |
if first == "a" or "e" or "i" or "o" or "u": | |
print "vowel" | |
else: |
OlderNewer