Skip to content

Instantly share code, notes, and snippets.

@kelp404
kelp404 / gist:e5f1079c3910fd4f2238
Created July 16, 2014 06:34
GlobalMiddleware in Python django
import threading
g = threading.local()
class GlobalMiddleware(object):
"""
Global variable.
"""
def process_request(self, request):
@kelp404
kelp404 / _urlEncode.md
Last active October 13, 2015 16:27
Url Encode

##Url Encode ###Objective-C

@kelp404
kelp404 / _backButtonInNavigation.md
Last active October 13, 2015 17:28
Change the text of the back button in navigationbar

##Back button'text in navigationbar ###Objective-C

@kelp404
kelp404 / gist:4572967
Last active December 11, 2015 08:28
Google App Engine note

#Google App Engine note

Update

appcfg.py update myapp/

Update backends

appcfg.py backends myapp/ update
@kelp404
kelp404 / _uuidString.md
Last active December 11, 2015 18:09
Generat UUID String

##Generat UUID String ###Objective-C

@kelp404
kelp404 / processingTime.m
Last active December 11, 2015 19:59
Logging code processing time

##Logging code processing time ###Objective-C

@kelp404
kelp404 / git_note.md
Last active December 12, 2015 01:19
Git note

#Git note

Tags

git tag -a <tag name> -m <comment>
git tag -d <tag name>

Push tags to remote

@kelp404
kelp404 / _remove_all_text_search_documents.md
Last active December 12, 2015 08:59
Remove all documents in text search (GAE)

##Remove all documents in text search (GAE) ###Python

@kelp404
kelp404 / -.js
Last active December 27, 2015 23:49
Array.prototype.remByVal = function(val) {
for (var i = 0; i < this.length; i++) {
if (this[i] === val) {
this.splice(i, 1);
i--;
}
}
return this;
};
//Call like