This file contains hidden or 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
function unsetvars { | |
unset word | |
unset poem | |
unset poems | |
unset line | |
unset counter | |
unset linenumber | |
} | |
This file contains hidden or 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
Note: I've left some of the full package names in tact to show exactly where the class comes from. | |
#### Pull dependencies in using composer #### | |
//Example composer.json | |
{ | |
"require": { | |
"symfony/config" : "2.1.0", | |
"symfony/yaml" : "2.1.0", | |
"twig/twig": "1.9.0", |
This file contains hidden or 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
<snippet> | |
<content><![CDATA[ | |
echo '<pre>' . print_r($0, true) . '</pre>'; exit; | |
]]></content> | |
<!-- Optional: Set a tabTrigger to define how to trigger the snippet --> | |
<tabTrigger>dump</tabTrigger> | |
<!-- Optional: Set a scope to limit where the snippet will trigger --> | |
</snippet> |
This file contains hidden or 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
EDIT: a quick google search revealed digitalcolor meter can show hex values so this task was pointless! | |
I've been doing some Android ui work recently. I keep finding myself needing to use a color from an image stored on my machine. I use OSX's digitalcolor meter tool to grab the rgb values from the image on screen then convert it into hex by asking google (e.g. searching '168 in hex'). | |
Repeatedly doing this task can be frustrating (you might argue that I should just convert them in my head, but why do that when a computer can do it?). So I made a quick function in my .bash_profile which allows me to do it at the command line: | |
rgb2hex(){ | |
for var in "$@" |
This file contains hidden or 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
function launchavd { | |
names=$(android list avd | grep 'Name' | awk '{ print $2 }') | |
for item in $names; do | |
echo "Launching VM $item" | |
nohup emulator -avd $item -no-skin -no-audio -no-window & | |
done | |
} |
This file contains hidden or 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
Debugging the SQLite database in Android can be a pain. A common technique is to dump the .sqlite database and inspect it using some program. | |
Sometimes we just want to know what has changed in the database within a time period, we can do this by dumping the database twice and comparing the two dumps. | |
This function speeds up the process of viewing differences between database dumps. | |
To use this function create an empty directory and navigate to it. This directory will be where we store dumps and perform comparisons. | |
Make sure you create a separate directory for each application you’re inspecting, or you may end up comparing dumps from different applications. | |
Usage: sqlitecompare <path_to_sqlite_file_on_device> e.g. sqlitecompare /data/data/com.2bard.foo/databases/userdb |
This file contains hidden or 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
#built application files | |
*.apk | |
*.ap_ | |
# files for the dex VM | |
*.dex | |
# Java class files | |
*.class |
This file contains hidden or 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
Movement: | |
j, k down, up | |
h, l left, right (in some contexts) | |
space page down | |
pg up/down page up/down | |
arrows up, down, left, right |
This file contains hidden or 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
To generate a v4 UUID then paste this to your bash/zsh profile: | |
alias givemeuuid="uuid -v4 | pbcopy && echo 'Copied a UUID to the clipboard.'" | |
Not tested on any OS other than OSX 10.9.5. |