Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am iewnait on github.
  • I am iewnait (https://keybase.io/iewnait) on keybase.
  • I have a public key whose fingerprint is 834B 19F6 D6E9 B944 B61F 650A 9526 4030 EAF1 391D

To claim this, I am signing this object:

:
Test Plan:
Reviewers:
Subscribers:
# CC:
set :stages, %w(production sandbox)
set :default_stage, "sandbox"
require 'capistrano/ext/multistage'
set :application, "blogtest"
set :repository, "git@github.com:iewnait/blogtest.git"
default_run_options[:pty] = true
set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent guess based on known version control directory names
@iewnait
iewnait / gist:2885359
Created June 6, 2012 22:59
2 mins work
{
"title" : "my_pane_title",
"groups" : [
{
"title" : "my_group_title",
"preferences" : [
{
"name" : "my_pref",
"type" : "integer",
"control" : "select",
@iewnait
iewnait / gist:2878754
Created June 5, 2012 23:20
Example code for WorldClock.query(ContentResolver cr, String[] projection, String where, String[] whereArgs, String orderBy)
String[] projections = new String [] {
WorldClock.Columns.CITY_UID,
WorldClock.Columns.NAME,
WorldClock.Columns.LONGITUDE,
WorldClock.Columns.TIMEZONE
}
String selection = WorldClock.Columns.TIMEZONE + " = '?'";
String[] selectionArgs = new String[] {"Asia/Tokyo"};
@iewnait
iewnait / gist:2878707
Created June 5, 2012 23:10
Example code for WorldClock.query(ContentResolver cr, String[] projection)
// Set this to null to get all Column.
String[] projections = new String [] {
WorldClock.Columns.CITY_UID,
WorldClock.Columns.NAME,
WorldClock.Columns.LONGITUDE,
WorldClock.Columns.TIMEZONE
};
Cursor cur = WorldClock.query(getContext().getContentResolver(),
projections
@iewnait
iewnait / gist:2877852
Created June 5, 2012 20:57
Example code for Weather.query(ContentResolver cr, String[] projection, String where, String[] whereArgs, String orderBy)
String[] projections = new String [] {
Weather.Columns.CITY_UID,
Weather.Columns.NAME,
Weather.Columns.DATE,
Weather.Columns.TEMP_HIGH,
Weather.Columns.TEMP_LOW,
Weather.Columns.LONGITUDE,
Weather.Columns.LATITUDE
};
@iewnait
iewnait / gist:2877754
Created June 5, 2012 20:45
Example code for Weather.query(ContentResolver cr, String[] projection)
Cursor cur = Weather.query(getContext().getContentResolver(),
null
);
while (cur.moveToNext()) {
Weather.WeatherInfo wi = Weather.getWeatherInfoFromCursor(cur);
// Do something useful with the weather info.
}
@iewnait
iewnait / gist:2876568
Created June 5, 2012 17:56
Example code for Calendars.Events.getEventsOnDay(ContentResolver cr, Time date)
// Set time to the same time tomorrow.
Time date = new Time();
date.setToNow();
date.weekDay = date.weekDay + 1;
Calendar.Event[] events = Calendar.Events.getEventsOnDay(getContext().getContentResolver(),
date
);
// Do something useful with these events.
@iewnait
iewnait / gist:2876517
Created June 5, 2012 17:46
Example code for Calendars.Events.getEventCursorForDay(ContentResolver cr, Time date)
// Set time to the same time tomorrow.
Time date = new Time();
date.setToNow();
date.weekDay = date.weekDay + 1;
Cursor cur = Calendar.Events.getEventCursorForDay(getContext().getContentResolver(),
date
);
while (cur.moveToNext()) {