Skip to content

Instantly share code, notes, and snippets.

<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="">
@c0ldlimit
c0ldlimit / index.html
Created September 4, 2014 19:10
#python #tornado pass arguments from tornado to js and not just html
# 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
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
@c0ldlimit
c0ldlimit / gist:3f4d20b978f5130c6b10
Created September 2, 2014 03:35
#python sqlite job queue
# 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
@c0ldlimit
c0ldlimit / gist:cec11d9441df163dbb78
Created August 27, 2014 14:35
#excel removing an add in
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*.
@c0ldlimit
c0ldlimit / gist:6228e8d63dc34c71a552
Last active August 29, 2015 14:05
#linux commands cheatsheet
# 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"
@c0ldlimit
c0ldlimit / gist:f3856f83844a49b73ff4
Created August 15, 2014 22:33
#python pip install inside ipython notebook
#saves having to exit and install stuff
import pip
def install(package):
pip.main(['install', package])
@c0ldlimit
c0ldlimit / gist:9aeacdbd42269cf76a58
Created August 12, 2014 15:36
Checking #python files for tab issues
# check if there are tab issues in python
python -m tabnanny yourfile.py
# in vim
:%retab
@c0ldlimit
c0ldlimit / gist:3c1731a2f49c78a55097
Last active August 29, 2015 14:04
#vagrant ubuntu with gui
# 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^
@c0ldlimit
c0ldlimit / gist:bb9c080f2a09f69b47b6
Last active August 29, 2015 14:04
#matplotlib #python quick reference
# 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