I hereby claim:
- I am apiguy on github.
- I am apiguy (https://keybase.io/apiguy) on keybase.
- I have a public key whose fingerprint is B007 ED9E C641 A8C8 BDAA 3EE0 1BAF 9671 E675 C159
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
alert('wooot'); |
time = .0 | |
seconds = 0 | |
while True: | |
time += .1 | |
seconds = int(time) | |
print "---------------" | |
print "Time to str: ", time | |
print "Time to int: ", int(time) | |
print "Seconds: ", seconds |
import timeit | |
setup = """ | |
import re | |
from itertools import ifilter | |
x = "active" | |
regex = re.compile(x, re.IGNORECASE) | |
def uppertest(): |
def if_(value, truth_test): | |
return value if truth_test else None | |
# Usage | |
""" | |
{{ active|if_(row.first) }} | |
""" |
#!/bin/bash | |
############################################### | |
# To use: | |
# https://raw.github.com/gist/2776351/??? | |
# chmod 777 install_postgresql.sh | |
# ./install_postgresql.sh | |
############################################### | |
echo "*****************************************" | |
echo " Installing PostgreSQL" | |
echo "*****************************************" |
#!/bin/bash | |
redis_version=2.6.13 | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.github.com/apiguy/5669466/raw/952b5221f46db37d1cda8fb04c6a23356b9c6338/install-redis.sh | |
# chmod +x install-redis.sh | |
# ./install-redis.sh |
class BlogView(FlaskView): | |
cacheable_views=('index') | |
def index(self): | |
return render_template('index.html') | |
def get(self, id): | |
return render_template('get.html') |
#!/usr/bin/env python | |
# Gribouillis at www.daniweb.com | |
""" | |
The class Grouper implements grouping strings by prefixes. | |
A Grouper object is created with a sequence of prefixes | |
G = Grouper(["pref1", "pref2", ...]) | |
(an empty prefix is automatically added). The Grouper object | |
is a dictionary "prefix --> set of strings". Initially, it looks | |
like | |
{ |
import cherrypy | |
from main import app | |
cherrypy.config.update({'server.socket_host': '0.0.0.0', | |
'server.socket_port': 8080}) | |
cherrypy.tree.graft(app) | |
if __name__ == '__main__': | |
try: | |
cherrypy.engine.start() |