Skip to content

Instantly share code, notes, and snippets.

View goopi's full-sized avatar

Gustavo Leguizamon goopi

  • Buenos Aires, Argentina
View GitHub Profile
@goopi
goopi / django-profiling.sh
Created October 3, 2014 00:13
Profiling Django using runprofileserver and QCacheGrind
$ # install QCacheGrind (KCacheGrind)
$ brew install qcachegrind
$ brew install graphviz
$ brew linkapps
$ pip install django-extensions
$ # run profiling server
$ ./manage.py runprofileserver 0:3000 --kcachegrind --prof-path=path/to/profiles
# A list of possible usernames to reserve to avoid
# vanity URL collision with resource paths
# It is a merged list of the recommendations from this Quora discussion:
# http://www.quora.com/How-do-sites-prevent-vanity-URLs-from-colliding-with-future-features
# Country TLDs found here:
# http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains#Country_code_top-level_domains
# Languages found here:
@goopi
goopi / reserved-usernames
Created April 29, 2013 04:28
Possible usernames to reserve to avoid vanity URL collision with resource paths
A list of possible usernames to reserve to avoid vanity URL collision with resource paths:
about
account
activate
admin
api
app
apps
archive
@goopi
goopi / vim-brew.sh
Created July 17, 2013 17:34
Install vim with brew #vim
$ brew install mercurial
$ brew install vim
# if /usr/bin is before /usr/local/bin in your $PATH,
# hide the system Vim so the new version is found first
$ sudo mv /usr/bin/vim /usr/bin/vim72
@goopi
goopi / tmux-cp-fix.md
Created July 25, 2013 17:11
Tmux copy & paste on OSX

Tmux copy & paste on OSX

Setup

$ brew install reattach-to-user-namespace

Add the following to ~/.tmux.conf

require('crypto').randomBytes(48).toString('hex');
@goopi
goopi / del-remote-git-tag.md
Created August 26, 2013 14:33
Delete a remote Git tag #git
$ git tag -d v1.0
$ git push origin :refs/tags/v1.0
@goopi
goopi / cd-debug.md
Created August 26, 2013 23:21
Core Data Debugging Fetching

Core Data Debugging Fetching

Pass the following as an argument to the application:

-com.apple.CoreData.SQLDebug 1

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/
  Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep -H UI_APPEARANCE_SELECTOR ./* | sed 's/ __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_5_0) UI_APPEARANCE_SELECTOR;//'

UIActivityIndicatorView

@goopi
goopi / tumblrproxy
Created September 4, 2013 17:17
An example of proxying a Tumblr blog as a subdirectory in nginx (w/o regexs)
server {
# ...
location / {
proxy_set_header Accept-Encoding '';
proxy_pass http://<NAME>.tumblr.com/;
sub_filter http://<NAME>.tumblr.com/post /post;
sub_filter_once off;
}