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 | |
#input sharelink here. Example: https://drive.google.com/folderview?id=0B1g-MbiD2F6vdtOT92b3MoerO&usp=sharing | |
SHARELINK="https://drive.google.com/folderview?id=idU&usp=sharing" | |
DESTINATION="/full/path/to/folder" | |
# Change following to false when you don't want to delete files when they are missing from google drive. This can | |
REMOVEFILES=true | |
# Begin code | |
download () { |
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 | |
if [[ -z "$1" ]]; | |
then | |
echo "No SVG file specified. Exiting." | |
exit -1 | |
fi | |
ispng=$(file $1) | |
echo $ispng | grep -q SVG |
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
public static void cancelAsyncTask(AsyncTask<?, ?, ?> task) { | |
if (task == null) { | |
return; | |
} | |
if (!task.getStatus().equals(AsyncTask.Status.FINISHED)) { | |
Logger.debug(TAG, "Cancelling AsyncTask " + task.toString() ); | |
task.cancel(true); | |
} | |
} |
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 -name "*.xml" -exec xmllint --format '{}' --output '{}' \; |
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
Strg Alt Shift Key Function | |
x Einf Generate/Insert dialog | |
x x ENTER Statements completion like blocks and brackets | |
x x T Surrond codeblock with… | |
x W Select succesively increasing code blocks | |
x F11 bookmarks and mark the line with selected key | |
x F11 invokes a list of bookmarks. Pressing a key takes to associated bookmark. | |
x x Backspace go to most recent code edit. Hit again to go even further back. | |
x E recent opened files | |
x x E recent edited files |
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
adjectives=[ | |
"adorable", | |
"adventurous", | |
"aggressive", | |
"alert", | |
"attractive", | |
"average", | |
"beautiful", | |
"blue-eyed ", | |
"bloody", |
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
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 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
'alrm=$(adb shell dumpsys alarm | grep $app | grep when | cut -f11 -d" "); for a in $alrm; do date --date="@"${a:0:-3}; 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
import java.text.SimpleDateFormat; | |
import java.util.Date; | |
import java.util.concurrent.CountDownLatch; | |
/** | |
* A simulation of a livelock between two persons passing each other in a narrow gallery. | |
*/ | |
public class GalleryLock { | |
final static boolean LOG_VERBOSE = false; |
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
private void loop(Deque<Runnable> rs, int delay) { | |
final Runnable first = rs.removeFirst(); | |
new Handler().post(first); | |
rs.addLast(first); | |
new Handler().postDelayed(() -> loop(rs, delay), delay); | |
} |
OlderNewer