#Sublime Text 2 - Shortcuts (Mac OSX)
##Default
###General
| Command | Shortcut |
|---|---|
| Command palette | ⌘ + ⇧ + P |
| Toggle side bar | ⌘ + K + B |
| def normalize_upper(data): | |
| return ''.join(x for x in normalize('NFKD', (data or '').decode('utf-8')) if x in string.printable).encode('ASCII','ignore') |
| #!/bin/bash | |
| # Tail an apache log an put some colors into the output | |
| # www.davideg.es | |
| shopt -s expand_aliases | |
| alias grey-grep="GREP_COLOR='1;30' grep -E --color=always --line-buffered" | |
| alias red-grep="GREP_COLOR='1;31' grep -E --color=always --line-buffered" | |
| alias green-grep="GREP_COLOR='1;32' grep -E --color=always --line-buffered" | |
| alias yellow-grep="GREP_COLOR='1;33' grep -E --color=always --line-buffered" |
| #!/usr/bin/env bash | |
| unalias mvn | |
| unalias maven | |
| unset -f mvn-color | |
| alias maven="command mvn" | |
| # Wrapper function for Maven's mvn command. |
| server { | |
| listen 80; | |
| server_name url.dev.infra; | |
| location / { | |
| proxy_pass http://url.dev.infra:3200; | |
| proxy_redirect off; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
| /* | |
| Code of "Dark Bleu" game from www.lessmilk.com/10/ | |
| Made with Phaser Javascript framework | |
| Note: the is the main source code. I skiped the boring part (preloading the assets, and the menus) | |
| */ | |
| /* | |
| Programming and art made by www.lessmilk.com | |
| You can freely look at the code below, |
| #!/usr/bin/env python | |
| """ | |
| http://www.openldap.org/faq/data/cache/347.html | |
| As seen working on Ubuntu 12.04 with OpenLDAP 2.4.28-1.1ubuntu4 | |
| Author: Roberto Aguilar <roberto@baremetal.io> | |
| """ | |
| import hashlib | |
| import os |
| #!/bin/bash | |
| if [ ! -f ~/.screenrc ] | |
| then | |
| cat << 'EOF' > ~/.screenrc | |
| caption always "%w" | |
| termcapinfo xterm ti@:te@ | |
| bindkey "^[[1;5D" prev | |
| bindkey "^[[1;5C" next |
| db.setProfilingLevel(2) -> debug mode | |
| db.system.profile.find().sort({$natural:-1}); -> example with first line representing last execution | |
| db.setProfilingLevel(0) -> disables debug mode | |
| db.coll_name.help() | |
| mongoexport --collection coll_name --out /tmp/dump.json --db db_name |
| // implementation-dependant (freemarker 2.3.14) | |
| private List<String> getTemplateVariables(Template freemarkerTemplate) throws IOException, TemplateModelException { | |
| SimpleSequence childNodes = (SimpleSequence) freemarkerTemplate.getRootTreeNode().getChildNodes(); | |
| List<String> dollarVariables = new ArrayList<String>(); | |
| for (Object object : childNodes.toList()) { | |
| if (object instanceof TemplateElement && ((TemplateElement) object).getCanonicalForm().startsWith("$")) { | |
| dollarVariables.add(((TemplateElement) object).getCanonicalForm()); | |
| } | |
| } | |
| return dollarVariables; |
#Sublime Text 2 - Shortcuts (Mac OSX)
##Default
###General
| Command | Shortcut |
|---|---|
| Command palette | ⌘ + ⇧ + P |
| Toggle side bar | ⌘ + K + B |