Skip to content

Instantly share code, notes, and snippets.

View gcollazo's full-sized avatar

Giovanni Collazo gcollazo

View GitHub Profile
@gcollazo
gcollazo / cocoa_keypress_monitor.py
Created June 29, 2012 19:14 — forked from ljos/cocoa_keypress_monitor.py
Showing how to listen to all keypresses in OS X through the Cocoa API using Python and PyObjC
# cocoa_keypress_monitor.py by Bjarte Johansen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
from Cocoa import NSApp, NSEvent, NSKeyDownMask
from Foundation import NSApplication, NSObject, NSLog
from PyObjCTools import AppHelper
class AppDelegate(NSObject):
def applicationDidFinishLaunching_(self, notification):
mask = NSKeyDownMask
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, handler)
@gcollazo
gcollazo / udp_hole_punch_tester.py
Created July 16, 2011 15:16 — forked from somic/udp_hole_punch_tester.py
UDP Hole Punching test tool
#!/usr/bin/env python
#
# udp_hole_punch_tester.py - UDP Hole Punching test tool
#
# Usage: udp_hole_punch_tester.py remote_host remote_port
#
# Run this script simultaneously on 2 hosts to test if they can punch
# a UDP hole to each other.
#
# * remote_port should be identical on 2 hosts.
#!/bin/bash
# To run do:
# wget https://gist.github.com/raw/850359/ea02e22f021b7ebf2f602811461677ab4a3f2a9e/bootstrap.sh && chmod +x bootstrap.sh && ./bootstrap.sh && source ~/.profile
#
# Based on Amazon EC2 AMI ID ami-ccf405a5 Ubuntu Server 10.10
# This script will:
# * install/config apache2
# * install mod_wsgi
# * install/config nginx
var old_data;
//Presentations
function presentations()
{
$.ajax({
url: '/jsonapi/presentations/',
type: 'POST',
dataType: 'json',
complete: function(xhr, textStatus) {
======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._
@gcollazo
gcollazo / fabfile.py
Created July 28, 2010 17:16 — forked from onyxfish/fabfile.py
Sample fabfile.py
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"