Skip to content

Instantly share code, notes, and snippets.

View NorthIsUp's full-sized avatar
🥯

Adam Hitchcock NorthIsUp

🥯
View GitHub Profile
/*
* AppController.j
* NewApplication
*
* Created by You on July 5, 2009.
* Copyright 2009, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
#!/usr/bin/python
import cherrypy
print cherrypy.__version__
class Root:
@cherrypy.expose
def index(self):
return "Hello world"
@NorthIsUp
NorthIsUp / gist:899027
Created April 1, 2011 23:09
boost --universal with pull request 4978
darwin.compile.c++ bin.v2/libs/python/build/darwin-4.2.1/release/address-model-32_64/architecture-x86/pch-off/threading-multi/object/function_doc_signature.o
In file included from /usr/local/Cellar/python/2.7.1/include/python2.7/Python.h:126,
from ./boost/python/detail/wrap_python.hpp:142,
from ./boost/python/detail/prefix.hpp:13,
from ./boost/python/converter/registrations.hpp:8,
from libs/python/src/object/function_doc_signature.cpp:9:
/usr/local/Cellar/python/2.7.1/include/python2.7/modsupport.h:27: warning: ‘PyArg_ParseTuple’ is an unrecognized format function type
In file included from /usr/local/Cellar/python/2.7.1/include/python2.7/Python.h:126,
from ./boost/python/detail/wrap_python.hpp:142,
from ./boost/python/detail/prefix.hpp:13,
@NorthIsUp
NorthIsUp / redis-server
Created June 15, 2011 22:52 — forked from tessro/redis-server
A CentOS initscript for Redis
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@NorthIsUp
NorthIsUp / web.py
Created January 24, 2012 19:52
flask/gunicorn concurrency example
"""
run with:
gunicorn -w 1 --worker-class gevent web
open in a browser:
localhost:8000/consumer
localhost:8000/consumer
localhost:8000/producer
@NorthIsUp
NorthIsUp / web.py
Created January 27, 2012 06:08
Example oauth for disqus api
from flask import Flask
app = Flask(__name__)
from flask import session
from flask import redirect
from flask import url_for
from flask import escape
from flask import request
import functools
@NorthIsUp
NorthIsUp / scratch.py
Created January 27, 2012 22:05
disqus list post example
@app.route("/forums/listposts/<shortname>")
def goodbye(shortname):
cu = current_user()
if cu:
return str(disqus.forums.listPosts(access_token=cu.access_token, forum=shortname))
else:
return "not auth'd!"
@NorthIsUp
NorthIsUp / hack.sh
Created March 31, 2012 19:12 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2267631/hack.sh | sh
#
import json
import os
seed = []
foo = os.path.expanduser("~/foo.json")
def load():
with open(foo, 'r') as fp:
return json.load(fp)
#!/bin/bash
#
# A git hook for automatically running commands
# based on the name of files modified in the
# previous changeset
#
# To install as a post-merge hook (on `git pull`):
# $ cp hook.sh .git/hooks/post-merge && chmod 755 $_
#
# To install as a post-checkout hook (changing branches):