Skip to content

Instantly share code, notes, and snippets.

View gregorynicholas's full-sized avatar
💀
alter.

gregory nicholas gregorynicholas

💀
alter.
View GitHub Profile
@lamberta
lamberta / gcal
Created October 1, 2011 16:19
Display calendar agenda using the Google command line tool.
#!/usr/bin/env bash
function print_help {
echo "Display the week's agenda from Google Calendar."
echo "Usage: $(basename $0) [options]"
echo " -h Show this usage guide."
echo " -t Today's agenda."
echo " -m Month agenda."
echo " -E Only display Event calendar."
echo "[Add event]"
@rochacbruno
rochacbruno / sublime-settings.js
Created October 3, 2011 01:05
Sublime text pyflakes ignore for web2py identifiers
/*
SublimeLinter default settings
*/
{
/*
Sets the mode in which SublimeLinter runs:
true - Linting occurs in the background as you type (the default).
false - Linting only occurs when you initiate it.
"load-save" - Linting occurs only when a file is loaded and saved.
@ivarvong
ivarvong / gist:1290194
Created October 15, 2011 21:43
exif_scrape_v1
import glob, subprocess
f = open('tally_out.txt', 'w')
base = "/Users/ivar/Pictures/"
directories = glob.glob(base+"11*.*");
def doStuff(file):
exifoutput = subprocess.check_output(["exiftool","-fast","-LensModel","-FocalLength","-Aperture","-FocusDistanceLower",file])
exifoutput = exifoutput.split("\n")
@minimal
minimal / commit-msg
Created October 21, 2011 09:29
Git precommit hooks - pylint and forbidden strings
#!/bin/sh
# From Gerrit Code Review 2.1.6.1
#
# Part of Gerrit Code Review (http://code.google.com/p/gerrit/)
#
# Copyright (C) 2009 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@LeverOne
LeverOne / LICENSE.txt
Created October 24, 2011 04:17 — forked from jed/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
@dsingleton
dsingleton / function-bind.js
Created October 25, 2011 11:10
Polyfill for Function.prototype.bind
Function.prototype.bind=Function.prototype.bind||function(b){if(typeof this!=="function"){throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");}var a=Array.prototype.slice,f=a.call(arguments,1),e=this,c=function(){},d=function(){return e.apply(this instanceof c?this:b||window,f.concat(a.call(arguments)));};c.prototype=this.prototype;d.prototype=new c();return d;};
@pamelafox
pamelafox / send.js
Created November 7, 2011 21:21
CORS XHR (jQuery/Flask)
function sendData(url, data, onSuccess, onError) {
$.ajax({
url: url,
type: 'POST',
data: data,
dataType: 'json',
xhrFields: {
withCredentials: true
},
@marians
marians / couchimport.py
Created November 11, 2011 11:57
Import of certain CSV data from STDIN to CouchDB
#!/opt/local/bin/python2.7
# encoding: utf-8
"""
couchimport.py
Created by Marian Steinbach on 2011-11-10.
"""
import sys
import os
import datetime
@lukmdo
lukmdo / gist:1373525
Created November 17, 2011 16:01
apple  wird commands

Add existing user to existing group

sudo dseditgroup -o edit -a USERNAME -t user GROUPNAME

Google Notifier AutocheckInterval

defaults write com.google.GmailNotifier AutocheckInterval EVERY_N_MINUTES
defaults delete com.google.GmailNotifier AutocheckInterval # to reset

Enabling/disabling at family commands

@abahgat
abahgat / gae-memcache-decorator.py
Last active April 27, 2025 09:47
A Python decorator to cache method results using memcache on Google AppEngine
import functools
import logging
from google.appengine.api import memcache
def cached(time=1200):
"""
Decorator that caches the result of a method for the specified time in seconds.
Use it as: