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
<div id="main-container"> | |
<div id="main"> | |
<h1> | |
<img alt="scubabook logo" src="{{ static_url("img/logo.png") }}"> | |
</h1> | |
<div id="login-form"> | |
<form action="/auth/login/" method="post" id="login_form"> | |
<fieldset> | |
<label for="username">Username</label> | |
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value=""> |
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
# http://stackoverflow.com/questions/19112296/how-to-pass-arguments-from-tornado-to-a-js-file-but-not-html | |
$ tree | |
. | |
├── static | |
│ └── scripts | |
│ └── test.js | |
├── templates | |
│ └── index.html | |
└── test.py |
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 gevent | |
from gevent.queue import Queue | |
tasks = Queue() | |
def worker(n, work_time): | |
while not tasks.empty(): | |
task = tasks.get() | |
print("Worker %s got tasks %s" % (n, task)) | |
gevent.sleep(work_time) # releases the greenlet to go do something 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
# http://flask.pocoo.org/snippets/88/ | |
import os, sqlite3 | |
from cPickle import loads, dumps | |
from time import sleep | |
try: | |
from thread import get_ident | |
except ImportError: | |
from dummy_thread import get_ident |
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
http://stackoverflow.com/questions/1946551/excel-add-in-doesnt-get-the-hint | |
C:\Program Files\Microsoft Office\Office*Version*\Xlstart | |
C:\Documents and Settings\*User name*\Application Data\Microsoft\Excel\XLSTART | |
Also, check the registry for Excel OPEN entries. Start -> Run -> regedit -> HKEY_CURRENT_USER\Software\Microsoft\Office\*version*\Excel\Options. Look for any values named OPEN*x*. |
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
# copy an entire directory | |
cp -R dirtocopy/ newdir/ | |
# view the last modified file in a directory | |
less $(ls -t *.out | head -1) | |
# redirection | |
# http://superuser.com/questions/480599/with-regards-to-piping-commands-what-are-the-greater-than-and-less-than | |
# http://en.wikipedia.org/wiki/Redirection_%28computing%29 | |
> "output to" |
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
#saves having to exit and install stuff | |
import pip | |
def install(package): | |
pip.main(['install', package]) |
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
# check if there are tab issues in python | |
python -m tabnanny yourfile.py | |
# in vim | |
:%retab |
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
# install virtualbox | |
# install vagrant | |
# full screen mode | |
# http://askubuntu.com/questions/184794/win7-on-virtualbox-and-full-screen-mode/184804 | |
sudo apt-get update | |
sudo apt-get install ubuntu-desktop^ | |
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
# change fontsize | |
http://stackoverflow.com/questions/12444716/how-do-i-set-figure-title-and-axes-labels-font-size-in-matplotlib | |
# change fontsize globally | |
http://stackoverflow.com/questions/3899980/how-to-change-the-font-size-on-a-matplotlib-plot | |
# where to store matplotlibrc | |
http://stackoverflow.com/questions/11535683/what-is-the-equivalent-to-home-in-a-virtualenv-python-specifically-for-matp | |
https://gist.github.com/huyng/816622 | |
# change figure size in ipython |