Skip to content

Instantly share code, notes, and snippets.

View fdanelyan's full-sized avatar

Fridon Danelyan fdanelyan

  • RusWizards
  • Taganrog
View GitHub Profile
@fdanelyan
fdanelyan / android-remove-log-proguard
Created May 16, 2014 06:40
Remove android logging code
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
@fdanelyan
fdanelyan / git-log-style
Created May 6, 2014 04:09
Show styled git log
git log --all --graph --decorate --oneline --abbrev-commit
@fdanelyan
fdanelyan / shell-files-tree
Created April 21, 2014 06:25
Show files tree of directory in shell
find . -print | sed -e '/^\.$/d' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
@fdanelyan
fdanelyan / get-file-from-android
Created April 18, 2014 08:03
Get database from root android device to Mac desktop
adb shell "su -c 'chmod 777 /data/data/com.android.providers.telephony/databases/mmssms.db'"
adb shell "su -c 'chmod 777 /data/data/com.android.providers.telephony/databases/telephony.db'"
adb shell "su -c 'chmod 777 /data/data/com.android.providers.contacts/databases/profile.db'"
adb shell "su -c 'chmod 777 /data/data/com.android.providers.contacts/databases/contacts2.db'"
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db /Users/fridondanelyan/Desktop/databases/mmssms.sqlite
adb pull /data/data/com.android.providers.telephony/databases/telephony.db /Users/fridondanelyan/Desktop/databases/telephony.sqlite
adb pull /data/data/com.android.providers.contacts/databases/profile.db /Users/fridondanelyan/Desktop/databases/profile.sqlite
adb pull /data/data/com.android.providers.contacts/databases/contacts2.db /Users/fridondanelyan/Desktop/databases/contacts2.sqlite
@fdanelyan
fdanelyan / generate_html.py
Created April 18, 2014 07:34
Generate HTML from python and open it on default browser
# write-html.py
import webbrowser
import os
print ()
f = open('helloworld.html','w')
message = """<html>
<head></head>
<body><p>Hello World!</p></body>
</html>"""
@fdanelyan
fdanelyan / android-cursor-to-html
Created April 17, 2014 13:16
Generate html content from Android cursor
Cursor cursor = ... // get cursor
try {
File myFile = new File("/sdcard/cursor_content.html");
myFile.createNewFile();
FileOutputStream fOut = new FileOutputStream(myFile);
OutputStreamWriter out = new OutputStreamWriter(fOut);
out.append("<!doctype html><html><head><title>Untitled</title>");
out.append("<style>table a:link{color:#666;font-weight:700;text-decoration:none}table a:visited{color:#999;font-weight:700;text-decoration:none}table a:active,table a:hover{color:#bd5a35;text-decoration:underline}table{font-family:Arial, Helvetica, sans-serif;color:#666;font-size:12px;text-shadow:1px 1px 0 #fff;background:#eaebec;border:#ccc 1px solid;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;-moz-box-shadow:0 1px 2px #d1d1d1;-webkit-box-shadow:0 1px 2px #d1d1d1;box-shadow:0 1px 2px #d1d1d1;margin:20px}table th{border-top:1px solid #fafafa;border-bottom:1px solid #e0e0e0;background:0;padding:21px 25px 22px}table th:first-child{text-align:left;padding-left:20px}table tr:first-child th:first