This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
""" | |
fabfile for Django | |
------------------ | |
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/ | |
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle) | |
several additions, corrections and customizations, too |
This file contains hidden or 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 math | |
import time | |
radius = 6371 | |
def distance(latA, lngA, latB, lngB): | |
latAr = math.radians(latA) | |
lngAr = math.radians(lngA) | |
latBr = math.radians(latB) | |
lngBr = math.radians(lngB) |
This file contains hidden or 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
#Newbie programmer | |
def factorial(x): | |
if x == 0: | |
return 1 | |
else: | |
return x * factorial(x - 1) | |
print factorial(6) | |
#First year programmer, studied Pascal |
This file contains hidden or 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
Sandwiches: | |
* Jay's Cheesesteaks (many seitan flavors) | |
* Ike's Place (tons of amazing veggie sandwiches) | |
* Toaster Oven (Potbelly's clone) | |
Mexican: | |
* Papalote (their house salsa is the best IN THE WORLD) | |
* El Buen Sabor (my favorite super veggie burrito) | |
* Taqueria Cancún (classic mission burrito; open till 2am on fri/sat, 1am other days, I think) |
This file contains hidden or 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
/** | |
* A simple preforking echo server in C. | |
* | |
* Building: | |
* | |
* $ gcc -Wall -o echo echo.c | |
* | |
* Usage: | |
* | |
* $ ./echo |
This file contains hidden or 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
./otp_build configure --host=arm-none-linux-gnueabi --build=i686-pc-linux-gnu --prefix=/opt/erlang erl_xcomp_sysroot=/opt/arm-2009q3 --disable-hipe --disable-threads --disable-smp --disable-megaco-flex-scanner-lineno --disable-megaco-reentrant-flex-scanner --disable-dynamic-ssl-lib --without-termcap --without-javac --without-ssl | |
./otp_build boot |
This file contains hidden or 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
local chat_demo = Handler { | |
send_spec = 'tcp://127.0.0.1:9999'; | |
send_ident = '8b7c7833-0932-4d9a-92c3-3b8c06d9b855'; | |
recv_spec = 'tcp://127.0.0.1:9998'; | |
recv_ident = ''; | |
} | |
local chat_demo_dir = Dir { | |
base = 'static/chatdemo/'; | |
index_file = 'index.html'; |
This file contains hidden or 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
local mongrel2 = require 'mongrel2' | |
local sender_id = '558c92aa-1644-4e24-a524-39baad0f8e78' | |
local sub_addr = 'tcp://127.0.0.1:8989' | |
local pub_addr = 'tcp://127.0.0.1:8988' | |
local io_threads = 1 | |
local response_string = [[ | |
<pre> | |
SENDER: %s |
This file contains hidden or 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
select meter_id, substring(logtime,1,7) month, max(demand) | |
from logdata | |
group by meter_id, substring(logtime,1,7) | |
order by meter_id, month |
This file contains hidden or 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
#!/bin/bash | |
function flask-boilerplate-tmux | |
{ | |
# https://github.com/swaroopch/flask-boilerplate | |
BASE="$HOME/src/flask-boilerplate" | |
cd $BASE | |
tmux start-server | |
tmux new-session -d -s flaskboilerplate -n model |
OlderNewer