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
/** | |
* complete.ly 1.0.0 | |
* MIT Licensing | |
* Copyright (c) 2013 Lorenzo Puccetti | |
* | |
* This Software shall be used for doing good things, not bad things. | |
* | |
**/ | |
completely = function completely(container, config) { | |
config = config || {}; |
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
$('body').hotKey({ | |
key: 's', | |
modifier: 'cmd' | |
}, saveNote) | |
$('body').hotKey({ | |
key: 'esc', | |
}, cancelNote) |
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
def wait(msg=''): | |
print msg | |
a = raw_input("press <enter> to continue...") | |
def yesno(msg): | |
print msg | |
a = raw_input('y/n: ') | |
if a == 'y': | |
return True |
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 pylab import * | |
from pprint import pprint | |
def arrayToList(arr): | |
if type(arr) == type(array([])): | |
return arrayToList(arr.tolist()) | |
elif type(arr) == type([]): | |
return [arrayToList(a) for a in arr] | |
else: |
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
When you're gitignore is not working as it should, clear the cache and re-commit the files. All thanks to this amazing answer: | |
http://stackoverflow.com/questions/11451535/gitignore-not-working | |
git rm -r --cached . | |
git add . | |
git commit -m "fixed untracked files" |
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
export PS1='\[\033[31m\]$ \[\033[32m\]' | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -GFh' |
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 multiprocessing import Pool | |
def f(x): | |
print x | |
return x**2 | |
if __name__ == '__main__': | |
# 8 processors | |
p = Pool(8) | |
a = range(100) |
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
Template.name.rendered = -> | |
# resize the text areas | |
Meteor.defer -> | |
$('.content').on( 'change keyup keydown paste cut', 'textarea', | |
-> $(this).height(0).height(this.scrollHeight)).find('textarea').change() | |
$('textarea').trigger('change') |
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
# An example of how to make decorators and also how *args and **kwargs work. | |
from functools import partial | |
def wrapping(func): | |
def wrapper(func, *args, **kwargs): | |
# print "wrapper" | |
# print func | |
# print args | |
# printwrappergs |
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 theano | |
import theano.tensor as T | |
import numpy | |
# The model basically looks like this: | |
# | |
# o_t a_t | |
# | | | |
# | | |