Skip to content

Instantly share code, notes, and snippets.

@g00fy-
g00fy- / RESTMiddleware.py
Created August 22, 2011 00:54
Simple Django Middleware for handling Form & Multipart Form PUT & DELETE methods AKA REST (GET,POST,PUT,DELETE)
from django.http import QueryDict
from django.http.multipartparser import MultiValueDict
class RESTMiddleware(object):
def process_request(self,request):
request.PUT=QueryDict('')
request.DELETE = QueryDict('')
method = request.META.get('REQUEST_METHOD','').upper() #upper ? rly?
if method == 'PUT':
self.handle_PUT(request)
@g00fy-
g00fy- / IndexedDB.setVersionShim.js
Created October 13, 2012 20:14 — forked from axemclion/IndexedDB.setVersionShim.js
Shim that converts Chrome's SetVersion to the standard IndexedDB onupgradeneeded events
////////////////////////////////////////////////////////////////////////////////////////////////////
var openReqShim = function(dbName, version){
var me = this;
var IDBRequest = function(){
this.onsuccess = this.onerror = this.onblocked = this.onupgradeneeded = null;
};
function copyReq(req){
req = req || dbOpenReq;
@g00fy-
g00fy- / gist:5027167
Created February 25, 2013 03:00
lazyAttr helper for emberjs style template bindings (draft)
LazyAttribute = function(attribute,context){
this.attribute = attribute;
this.context = context;
this.id = _.uniqueId('h');
this.bindEvents();
};
LazyAttribute.prototype.bindEvents = function(){
this.context.on('change:'+this.attribute.split('.')[0],this.update,this);
};

Twitter公式クライアントのコンシューマキー

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPad

Consumer key: CjulERsDeqhhjSme66ECg

@g00fy-
g00fy- / .gitignore
Last active August 29, 2015 14:06 — forked from GerHobbelt/.gitignore
# Editor backup files
*.bak
*~
@g00fy-
g00fy- / designer.html
Last active August 29, 2015 14:06
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
@g00fy-
g00fy- / angular-template-url-opt
Created September 26, 2014 13:50
Perf - compile
if(directive.templateUrl){
var tmplUrl = (isFunction(directive.templateUrl))
? directive.templateUrl($compileNode, templateAttrs)
: directive.templateUrl
var template = $templateCache.get(tmplUrl);
if(template){
directive = extend({},{templateUrl:null,template:template})
}
}
#
# KMS Client Setup Keys: http://technet.microsoft.com/en-us/library/jj612867.aspx
#
####################################################################
# Windows 8.1 Enterprise Evaluation ISO:
# @url: http://go.microsoft.com/fwlink/?LinkId=302161
####################################################################
@g00fy-
g00fy- / install-docker-compose.sh
Last active August 26, 2015 12:31 — forked from lmakarov/install-docker-compose.sh
Install docker-compose in boot2docker 1.7.0+
#!/bin.sh
DOCKER_COMPOSE_VERSION=1.3.0
# Download docker-compose to the permanent storage
echo 'Downloading docker-compose to the permanent VM storage...'
sudo mkdir -p /var/lib/boot2docker/bin
sudo curl -sL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose
sudo chmod +x /var/lib/boot2docker/bin/docker-compose
sudo ln -sf /var/lib/boot2docker/bin/docker-compose /usr/local/bin/docker-compose