This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install -v apparix | |
# Installed to: /opt/foo/Cellar/apparix/11-0/bin/apparix | |
# Add bm/to Bash functions from man page to .bashrc or .local.bash: | |
man -P cat apparix | awk '/BASH-style functions/{p=1} /---/{if(p==1)p=2; else p=0; next} p>1{print}' >> ~/.local.bash | |
# Reload my bash config: | |
source ~/.local.bash | |
# Now create a bookmark: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Combine multiple images into one. | |
# | |
# To install the Pillow module on Mac OS X: | |
# | |
# $ xcode-select --install | |
# $ brew install libtiff libjpeg webp little-cms2 | |
# $ pip install Pillow | |
# | |
from __future__ import print_function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GerritUsersListProvider(object): | |
def get_users(self): | |
"""Gets the Gerrit users emails as a string list.""" | |
server = os.environ.get('GERRIT_SERVER', GERRIT_SERVER) | |
logging.debug('Querying all user accounts from ' + server) | |
text = subprocess.check_output([ | |
'ssh', '-p', '29418', server, 'gerrit', 'gsql', '--format', | |
'JSON_SINGLE', '-c', "'select preferred_email from accounts'"]) | |
accounts_json = json.loads(text) | |
return self.json_to_list(accounts_json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sometimes it's handy to create small anonymous objects instead of explicitly defining a class for it, especially while prototyping. | |
def new(name, data): | |
return type(name, (object,), data) | |
person = new('Person', { 'name': 'Joe', 'age': 30 }) | |
print(person.name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIRS=$(find ~/.android/avd -name '*ini' | xargs grep 'sysdir' | cut -d '=' -f 2) | |
IFS=$'\n' read -rd '' -a array <<< "$DIRS" | |
for d in "${array[@]}" | |
do | |
X="${ANDROID_HOME}/$d" | |
if [ ! -d $X ]; then | |
echo Missing emulator image: $X | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nginx] | |
name=nginx repo | |
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ | |
gpgcheck=0 | |
enabled=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~/Library/Spelling/ | |
curl -O http://cgit.freedesktop.org/libreoffice/dictionaries/tree/af_ZA/af_ZA.aff | |
curl -O http://cgit.freedesktop.org/libreoffice/dictionaries/tree/af_ZA/af_ZA.dic | |
# Now go to System Preferences -> Keyboard -> Text -> Set up and select the language. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:1.0.1' | |
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This is a quick and dirty script to parse SdkConfig.java from the | |
Robolectric sources on GitHub to determine the list of dependencies we need | |
to use the Robolectric Test Runner in offline mode. It then generates a Maven | |
pom.xml file that can be used to download all the necessary depedenency jars | |
from maven central. | |
Author: @codeblast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find /var/folders -name '*robolectric*' | xargs rm -Rf | |
rm -Rf ~/.m2 | |
rm -Rf ~/.gradle/caches |