Skip to content

Instantly share code, notes, and snippets.

View clarkli86's full-sized avatar

Clark Li clarkli86

  • Adelaide, Australia
View GitHub Profile
Intent emailIntent = new Intent(Intent.ACTION_SENDTO, Uri.fromParts(
"mailto","[email protected]", null));
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "EXTRA_SUBJECT");
startActivity(Intent.createChooser(emailIntent, "Send email..."));
@clarkli86
clarkli86 / launch_chrome.bat
Created November 18, 2014 10:41
Allow chrome to load local files
chrome --user-data-dir="C:\Users\guihua\Documents\GitHub\programming_questions_mind_mapping" --disable-web-security
@clarkli86
clarkli86 / sha256sum_recursively.sh
Created December 18, 2014 03:38
sha256sum on all files recursively
find directory -type f -print0 | xargs -0 sha256sum
@clarkli86
clarkli86 / Create tar.sh
Last active August 29, 2015 14:15
Deploy qt windows application
tar cvfz file.tar.gz folder1 folder2 ...
@clarkli86
clarkli86 / install_git_hooks.sh
Created March 10, 2015 02:10
Install commit-msg hook for every git submodule
git submodule foreach 'scp review:hooks/commit-msg $(git rev-parse --git-dir)/hooks'
@clarkli86
clarkli86 / cherry-pick-from-another-branch.sh
Created May 6, 2015 03:14
Cherry pick all commits after a specified hash from another branch
# All commits after 53c2 on jd/master branch will be cherry-picked into the current branch
git rev-list --reverse 53c2..jd/master | git cherry-pick --stdin
@clarkli86
clarkli86 / convert.py
Created June 10, 2015 07:17
Convert Android strings.xml into iOS Localizable.strings
#!/usr/bin/python
import xml.etree.ElementTree as ET
import sys, getopt
def read_from_xml(infile):
tree = ET.parse(infile)
root = tree.getroot()
pairs = []
for string in root:
@clarkli86
clarkli86 / chmod_recursively.sh
Created June 16, 2015 05:30
chmod all *.c files in directory
find . -name \*.c -print0 | xargs -0 chmod -x
@clarkli86
clarkli86 / initializer_list
Created August 18, 2015 06:23
range-based-for and initializer_list in C++
for (int x : {-1, -2, -3}) // the rule for auto makes this ranged-for work
std::cout << x << ' ';
@clarkli86
clarkli86 / bitbake_dependency_graph
Created August 18, 2015 08:11
bitbake dependency graph
The bitbake -g targetname command creates the pn-buildlist, pn-depends.dot, package-depends.dot, and task-depends.dot files in the current directory. These files show what will be built and the package and task dependencies, which are useful for debugging problems. You can use the bitbake -g -u depexp targetname command to display the results in a more human-readable form.