Skip to content

Instantly share code, notes, and snippets.

View planetguru's full-sized avatar

Christopher Lacy-Hulbert planetguru

View GitHub Profile
@EmmanuelOga
EmmanuelOga / commit-msg
Created February 7, 2014 17:40
Commit message hook: include name of the branch on the commit message.
#!/usr/bin/env ruby
#
# Git commit-msg hook. If your branch name is in the form "US1234-postfix", or
# "US1234_postfix", it automatically adds the prefix "[US1234]" to commit
# messages.
#
# If you include "#noref" in the commit message, nothing will be added to the
# commit message, and the "#noref" itself will be stripped.
#
# Install:
@planetguru
planetguru / Android Async data fetch
Created March 26, 2013 10:05
Android/Java code for managing download/service access tasks asynchronously via a generic query task and generic fetchdata method..
private class QueryTask extends AsyncTask<String, Void, String> {
String role = new String();
@Override
protected String doInBackground(String... querySections) {
/* querySections: requestURL, requestQuery, role (index/data) */
String data = "", requestQuery = new String();
role = querySections[2];
try {
requestQuery = URLEncoder.encode(querySections[1], "UTF-8");