Skip to content

Instantly share code, notes, and snippets.

View alecklandgraf's full-sized avatar

Aleck Landgraf alecklandgraf

View GitHub Profile
@nbremer
nbremer / .block
Last active August 14, 2023 23:44
D3.js - Radar Chart or Spider Chart - Adjusted from radar-chart-d3
height: 650
license: mit
@jeremyjbowers
jeremyjbowers / my_app.conf
Created December 31, 2012 01:29
This is an upstart configuration file to execute uWSGI as a daemon on Ubuntu-recent (10.x, 12.x). For more info on upstart: http://upstart.ubuntu.com/getting-started.html. This file would live in /etc/init/ and you'd need to do sudo initctl reload-configuration on the initial file creation and then sudo service my_app start/restart/stop to contr…
description "uWSGI server for electris CMS"
start on runlevel [2345] # start on all runlevels.
stop on runlevel [!2345] # stop when shutting down.
respawn # respawn if job crashes or is stopped ungracefully.
env DEPLOYMENT_TARGET=production # set any environment variables you like here.
env DJANGO_SETTINGS_FILE=conf/settings.py # more environment variables if you like.
env PYTHONPATH=/home/ubuntu/apps/my_app:/home/ubuntu/.virtualenv/my_app
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@enjalot
enjalot / index.html
Created November 18, 2011 23:56
d3 behavior.drag example
<!DOCTYPE html>
<html>
<head>
<title>Chernoff Smileys</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.5.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js?2.5.0"></script>
<style type="text/css">
</style>
</head>
@diox
diox / clear_johnny_cache.py
Created July 5, 2011 16:30
Django management command to clear johnny-cache cache :-)
import sys
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
help = ("Invalidates portions of the queryset cache based on the app names"
" or models provided as arguments to the command. If no arguments "
"are provided, nothing is done. To clear the entire queryset "
@mdellavo
mdellavo / xls-dict-reader.py
Created October 21, 2010 18:59
XLS to Dict Reader using xlrd
try:
import xlrd
def XLSDictReader(f, sheet_index=0):
data = mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ)
book = xlrd.open_workbook(file_contents=data)
sheet = book.sheet_by_index(sheet_index)
def item(i, j):
return (sheet.cell_value(0,j), sheet.cell_value(i,j))