Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View monokrome's full-sized avatar
😻
meow

Bailey Stoner monokrome

😻
meow
View GitHub Profile
@monokrome
monokrome / server.coffee
Created September 8, 2011 22:22
Does line #12 create a race condition?
express = require 'express'
server = express.createServer()
server.configure 'development', ->
server.set 'listening-port' 8000
server.configure 'production', ->
server.set 'listening-port' 80
server.listen server.set 'listening-port'
aardwolf !!
aff
airproof !!
alef !!
alif !!
aloof !!
antidandruff
aperitif !!
arf !!
- babyproof !!
somefile
somefile
somefile
somefile
somefile
somefile
somefolder
somechild
somechild
somechild
@monokrome
monokrome / gist:1218955
Created September 15, 2011 10:06
Homebrew / PostgreSQL Setup Information
If builds of PostgreSQL 9 are failing and you have version 8.x installed,
you may need to remove the previous version first. See:
https://github.com/mxcl/homebrew/issues/issue/2510
To build plpython against a specific Python, set PYTHON prior to brewing:
PYTHON=/usr/local/bin/python brew install postgresql
See:
http://www.postgresql.org/docs/9.0/static/install-procedure.html
some_view = (req, res, next) ->
res.render 'sometemplate.jade',
favorite_fruit: ['apples', 'oranges', 'bananas']
@monokrome
monokrome / gist:1231326
Created September 21, 2011 05:29
CORS middleware for Django
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django.conf import settings
from django import http
XS_SHARING_ALLOWED_ORIGINS = getattr(settings, 'XS_SHARING_ALLOWED_ORIGINS', ['*'])
express = require 'express'
stylus = require 'stylus'
path = require 'path'
public_dir = (filename) -> path.join __dirname, '../public', filename or ''
get_stylus_options = (server) ->
stylus_options =
compress: server.env == 'production'
debug: server.env != 'production'
# PHP (theory, really - this is hundreds of lines of refacatoring)
jempe_users
user_id
blah
blha
blah
jempe_employees
user_id
blah
<!DOCTYPE html>
<html>
<head>
<script src="/scripts/jquery.min.js" />
<script defer src="/scripts/application.js" />
</head>
<body>
var obj, $some_object, text;
$some_object = jQuery('#something li')
text = ''
for (obj in $some_object)
{
text = text + obj.text();
}