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
(gidsy)hannes@tpHannes:~/code/Gidsy$ grep alias ~/.bashrc | |
# ~/.bash_aliases, instead of adding them here directly. | |
#if [ -f ~/.bash_aliases ]; then | |
# . ~/.bash_aliases | |
# enable color support of ls and also add handy aliases | |
alias ls='ls --color=auto' | |
#alias dir='ls --color=auto --format=vertical' | |
#alias vdir='ls --color=auto --format=long' | |
# some more ls aliases | |
alias ll='ls -lh' |
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
#!/bin/bash | |
git diff --cached | grep ^+ | grep 'pdb.set_trace()' > /dev/null | |
if [ $? = '0' ]; then | |
echo "You're about to commit code with pdb statements. Please remove them!" | |
echo "Run 'git diff --cached' to see what you're about to commit." | |
exit 1 | |
fi |
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
In [11]: timeit.timeit(""" | |
....: a = "asd" | |
....: b = "dsa" | |
....: a + b""", number=10**8) | |
Out[11]: 8.79588794708252 | |
In [12]: timeit.timeit(""" | |
....: a = "asd" | |
....: b = "dsa" | |
....: "%s%s" % (a, b)""", number=10**8) |
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
ffmpeg -y -i input.avi -c:v libx264 -preset fast -c:a copy -r 15 output.mp4 |
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
DBNAME= | |
QUERY="select tablename from pg_catalog.pg_tables where tablename not like 'sql_%' and tablename not like 'pg_%';" | |
for table in `psql $DBNAME -t -c "$QUERY"`; do | |
TABLE_QUERY="select pg_size_pretty(pg_relation_size('$table'));" | |
TABLE_SIZE=`psql $DBNAME -t -c "$TABLE_QUERY"` | |
TOTAL_QUERY="select pg_total_relation_size('$table');" | |
TOTAL=`psql $DBNAME -t -c "$TOTAL_QUERY"` | |
INDEX_QUERY="select pg_size_pretty(pg_total_relation_size('$table') - pg_relation_size('$table'));" |
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
#!/bin/sh | |
SOURCE="/PFAD/ZU/Apps Native/Android/_Assets" | |
TARGET=/PFAD/ZU/openfish/GYG_Android/res | |
set -x | |
cp "$SOURCE/mdpi/$1" "$TARGET/drawable-ldpi/" | |
cp "$SOURCE/mdpi/$1" "$TARGET/drawable-mdpi/" | |
cp "$SOURCE/hdpi/$1" "$TARGET/drawable-hdpi/" |
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
configurations { | |
androidTestCompile.exclude group: 'com.android.support', module: 'support-v4' | |
} |
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
@Module(injects = MyActivityModule.class) | |
class MotherModule { | |
// ...snip | |
} | |
@Module( | |
addsTo = MotherModule.class, | |
injects = {MyActivity.class, MyFragment.class} | |
) | |
class MyActivityModule { |
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
import android.util.Log; | |
import rx.Observable; | |
import rx.Observer; | |
class Either<T> { | |
private final T value; | |
private final Throwable throwable; | |
public static <T> Either<T> ofValue(T value) { |
OlderNewer