#Sublime Text 2 - Shortcuts (Mac OSX)
##Default
###General
| Command | Shortcut |
|---|---|
| Command palette | ⌘ + ⇧ + P |
| Toggle side bar | ⌘ + K + B |
| import static java.lang.Math.min; | |
| import static java.lang.String.format; | |
| import static java.lang.System.getProperty; | |
| import static java.nio.charset.Charset.defaultCharset; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import java.util.Arrays; | |
| import java.util.concurrent.Callable; |
| "zip | |
| @echo off | |
| set arg1=%* | |
| @echo on | |
| _7za.lnk a -tzip %1.zip %arg1% | |
| pause | |
| "unzip | |
| set arg1=%1 | |
| pause | |
| _7za.lnk x %arg1% -o%1_dir |
| #.nanorc | |
| # logging syntax highlighting | |
| # | |
| # * initially based on log-stuff.nanorc (github.com/mattpowell/.nanorc), changed completely to adapt to log4j. | |
| syntax "logs" "\.*(out|err|log|tdump|hprof)\.*$" | |
| # markers and keywords | |
| color brightwhite "[[:punct:]]" | |
| color brightwhite start="(\[|<|\{|\()" end="(\]|>|\}|\))" | |
| color brightblack "(\[|\{|\(|<|\]|\}|\)|>)" |
| <NotepadPlus> | |
| <UserLang name="log4j" ext="log"> | |
| <Settings> | |
| <Global caseIgnored="yes" /> | |
| <TreatAsSymbol comment="no" commentLine="no" /> | |
| <Prefix words1="no" words2="no" words3="no" words4="yes" /> | |
| </Settings> | |
| <KeywordLists> | |
| <Keywords name="Delimiters">[(0])0</Keywords> | |
| <Keywords name="Folder+"></Keywords> |
| <NotepadPlus> | |
| <UserLang name="log4j_dark" ext="log" udlVersion="2.1"> | |
| <Settings> | |
| <Global caseIgnored="yes" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
| <Prefix Keywords1="no" Keywords2="yes" Keywords3="no" Keywords4="yes" Keywords5="no" Keywords6="yes" Keywords7="no" Keywords8="no" /> | |
| </Settings> | |
| <KeywordLists> | |
| <Keywords name="Comments"></Keywords> | |
| <Keywords name="Numbers, prefix1"></Keywords> | |
| <Keywords name="Numbers, prefix2"></Keywords> |
#Sublime Text 2 - Shortcuts (Mac OSX)
##Default
###General
| Command | Shortcut |
|---|---|
| Command palette | ⌘ + ⇧ + P |
| Toggle side bar | ⌘ + K + B |
| // 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; |
| 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 |
| #!/bin/bash | |
| if [ ! -f ~/.screenrc ] | |
| then | |
| cat << 'EOF' > ~/.screenrc | |
| caption always "%w" | |
| termcapinfo xterm ti@:te@ | |
| bindkey "^[[1;5D" prev | |
| bindkey "^[[1;5C" next |
| #!/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 |