This gist has graduated to a full-fledged repo @ https://github.com/JakeWharton/ProcessPhoenix
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
| //- templated by jade | |
| svg(width=640 height=480 style="background-color:grey;") | |
| circle( | |
| cx=30 cy=30 | |
| r=25 | |
| stroke="grey" stroke-width=1 | |
| fill="wheat") | |
| rect( | |
| width=50 height=50 | |
| x=60 y=10 |
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
| public class MainActivity extends Activity { | |
| private final MyActivityLifecycleCallbacks mCallbacks = new MyActivityLifecycleCallbacks(); | |
| @Override | |
| protected void onCreate(Bundle savedInstanceState) { | |
| // Always register before calling into the super class. | |
| getApplication().registerActivityLifecycleCallbacks(mCallbacks); | |
| super.onCreate(savedInstanceState); |
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 dex-method-count() { | |
| cat $1 | head -c 92 | tail -c 4 | hexdump -e '1/4 "%d\n"' | |
| } | |
| function dex-method-count-by-package() { | |
| dir=$(mktemp -d -t dex) | |
| baksmali $1 -o $dir | |
| for pkg in `find $dir/* -type d`; do | |
| smali $pkg -o $pkg/classes.dex | |
| count=$(dex-method-count $pkg/classes.dex) | |
| name=$(echo ${pkg:(${#dir} + 1)} | tr '/' '.') |
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
| use strict; | |
| use warnings; | |
| my $host = $ARGV[0] or die; | |
| my $ssh = 'ssh -t'; | |
| my $cmd = 'tail -F -n0 /tmp/hoge.log'; | |
| my $pid = open my $fh, '-|', qq/$ssh $host '$cmd'/ or die; | |
| while (<$fh>) { | |
| if (/hoge/) { |