Skip to content

Instantly share code, notes, and snippets.

View parente's full-sized avatar
🦡

Peter Parente parente

🦡
View GitHub Profile
@parente
parente / dojo-seed.html
Created February 11, 2010 01:35
dojo seed
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Dojo Template</title>
<style type="text/css">
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/resources/dojo.css";
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css";
/* include your main application css here */
/*@import "css/your_css.css";*/
@parente
parente / gist:327887
Created March 10, 2010 14:03
serpinkski
# by finite (http://www.reddit.com/r/4chan/comments/bb06w/alright_you_bastards_how_do_i_triforce/c0lwko2)
# saved as a gist for posterity
python -c 'print chr(10).join("".join((" ","▲")[c] for c in l)for l in reduce(lambda s,n,w=90:s+[[w>>(s[-1][i-1]*4+s[-1][i]*2+s[-1][(i+1)%len(s[0])])&1 for i in range(len(s[-1]))]],range(31),[[0]*31+[1]+[0]*31]))'
@parente
parente / gist:331040
Created March 13, 2010 02:06
montage.py
#!/usr/bin/python
'''Yet another Montage experiment for desktop wallpaper
This version works with a variant on the "Pseudo-Poisson" dart throwing algorithms
that were popular in stochastic ray-tracing years ago. It throws darts at a rectangular
region ensuring that no darts are closer together than a minimum distance. It allows the
minimum distance to scale down so you can have some big pictues and some smaller pictures.
The help text was intended to be self explanatory...
@parente
parente / nginx.conf
Created March 26, 2010 19:38
sample nginx.conf
#user nginx;
worker_processes 5;
error_log /opt/local/var/log/nginx/error.log;
pid /opt/local/var/run/nginx.pid;
events {
worker_connections 1024;
}
@parente
parente / b.sh
Created May 28, 2010 15:38
run in background, output to log
#!/bin/bash
LOG=~/Applications/bin/b.log
echo "<<($@)" >> $LOG
$($@ >> $LOG 2>> $LOG; echo ">>($@)" >> $LOG) &
@parente
parente / .gitconfig
Created September 3, 2010 02:52
.gitconfig
[user]
name = Peter Parente
email = parente@cs.unc.edu
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
@parente
parente / inotes.user.js
Created November 16, 2010 16:52
my hacky inotes userscript
// ==UserScript==
// @name inotes
// @namespace http://aether.raleigh.ibm.com/
// @description Adds Dock badge and Growl notification to iNotes in a Fluid SSB browser
// @include *
// @author Peter Parente <pparent@us.ibm.com>
// ==/UserScript==
(function () {
var authCol = 'e-listview-container-mail-Col2';
@parente
parente / setup_tornadoenv.py
Created January 3, 2011 02:25
Create a virtualenv for a Tornado app
#!/usr/bin/env python
'''
Setup a virtualenv with tornado/master and a run script to serve static files.
'''
import virtualenv
import os
import subprocess
import stat
def after_install(options, home_dir):
@parente
parente / index.html
Created January 25, 2011 14:52
playing with requirejs + Dojo 1.5 XD
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>RequireJS + Dojo XD sandbox</title>
<style type="text/css">
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/resources/dojo.css";
@import "http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css";
</style>
<script data-main="main" src="js/require.js"></script>
@parente
parente / apache.conf
Created February 4, 2011 15:14
nginx config for aether
server {
listen 80;
server_name aether.raleigh.ibm.com;
server_name_in_redirect off;
access_log /Users/parente/servers/logs/aether_access.log;
location / {
proxy_pass http://localhost:8080;
proxy_pass_header Server;
proxy_set_header X-Real-IP $remote_addr;