Skip to content

Instantly share code, notes, and snippets.

View chrisgeo's full-sized avatar

Chris George chrisgeo

  • San Francisco, CA
View GitHub Profile
class TimeSheet(models.Model):
time_started = models.DateTimeField("Time Started", null=True, blank=True)
time_finished = models.DateTimeField("Time Finished", null=True, blank=True)
class TimeSheetForm(forms.ModelForm):
class Meta:
model = TimeSheet
widgets = {
'time_started': forms.DateInput,
@chrisgeo
chrisgeo / toggle_airplay
Created March 18, 2015 20:26
Enable and Disable Airplay Script
#! /bin/sh
#######
#
# Script to enable and disable airplay in OS X
#
#########
AIRPLAY=/System/Library/CoreServices/AirPlayUIAgent.app/Contents/MacOS/AirPlayUIAgent
disable() {
@chrisgeo
chrisgeo / LeadGeniusAPI.markdown
Last active January 9, 2022 02:36
LeadGenius API

LEADGENIUS API

Welcome to the leadgenius API. Below is the layout and relevant use cases.

RESPONSE CODES

STATUS CODES DESCRIPTION
200 OK Request processed successfully, look at response object for details
202 Accepted Means the request has been put in a queue for processing
"""
Write a function that takes a list of positive integers as an input, and returns all of the pairs of integers it contains that sum to 100.
You can assume that all inputs are between 1 and 99.
Example Inputs and Outputs:
[ 1, 98, 99 ] => [ [1, 99] ]
[ 95, 5, 95 ] => [ [ 5, 95 ] ]
[ 95, 5, 95, 5 ] => [ [ 5, 95 ], [ 5, 95 ] ]
> 95 [5, 95, 5]
"""
Write a function that takes a list of positive integers as an input, and returns all of the pairs of integers it contains that sum to 100. You can assume that all inputs are between 1 and 99.
Example Inputs and Outputs:
[ 1, 98, 99 ] => [ [1, 99] ]
[ 95, 5, 95 ] => [ [ 5, 95 ] ]
[ 95, 5, 95, 5 ] => [ [ 5, 95 ], [ 5, 95 ] ]
> 95 [5, 95, 5]
> 5, 95 [95, 5]
@chrisgeo
chrisgeo / set_git_email
Created May 7, 2014 15:58
Pre-commit hook set git email based on remote url
#!/bin/sh
HOST = 'myhost'
EMAIL=`git config user.email`
if [[ ${EMAIL} == '' ]]; then
printf "ERROR: You need to set up your email.\n\n"
exit 1
fi
git_remote=`git branch -vv | perl -n -e'/^\*.*\[(.*)\/.*\].*/ && print $1'`
@chrisgeo
chrisgeo / fullapp.py
Created April 18, 2014 12:14
Test add_request_method
class TestFooAddRequest(unittest.TestCase):
def setUp(self, environ=None):
self.wsgi_app = self.config.make_wsgi_app()
from webtest import TestApp
self.test_app = TestApp(
self.wsgi_app
)
def _makeRequest(self, environ=None):
if environ is None:
class FooRequest(WebRequest):
def foo(self):
return self.environ['foo.bar']
@chrisgeo
chrisgeo / Custom.css
Last active December 14, 2015 14:29
Chrome Custom.css file
/*
Chrome Developer Tools - Monokai Color Theme
Author: Béres Máté Csaba / bjmatt.com / @bjmatt / beres.mate@bjmatt.com
-----------------------------------------------------------------------------------------------------------
Installation:
1. Find your Chrome's user stylesheet's directory, for example in win7:
"c:\Users\***YOUR USERNAME***\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\"

CINNAMON BEEF STEW

AMOUNT UNIT INGREDIENT
2-3 LBS Beef Stew Meat
To taste - Salt & Pepper
3 TBSP Coconut Oil
1 Medium - Carrot
1 Medium - Onion