Skip to content

Instantly share code, notes, and snippets.

View btbytes's full-sized avatar
🐎
🏈

Pradeep Gowda btbytes

🐎
🏈
View GitHub Profile
@btbytes
btbytes / fabfile.py
Created December 18, 2009 20:29 — forked from fiee/fabfile.py
#!/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
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)
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
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)
@btbytes
btbytes / echo.c
Created March 31, 2010 01:37 — forked from paulsmith/echo.c
/**
* A simple preforking echo server in C.
*
* Building:
*
* $ gcc -Wall -o echo echo.c
*
* Usage:
*
* $ ./echo
@btbytes
btbytes / 0_commands.txt
Created September 12, 2010 16:37 — forked from alexeyr/0_commands.txt
building Erlang OTP for the ARM.
./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
@btbytes
btbytes / config.lua
Created September 14, 2010 20:04 — forked from jsimmons/config.lua
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';
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
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
#!/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