Skip to content

Instantly share code, notes, and snippets.

View konklone's full-sized avatar

Eric Mill konklone

View GitHub Profile
<!--
In your AndroidManifest.xml, designate the class that will handle creating a shortcut.
-->
<activity android:name=".CreateShortcut"
android:label="Name To Appear on the Shortcuts Menu"
>
<intent-filter>
<action android:name="android.intent.action.CREATE_SHORTCUT" />
$ mongo
MongoDB shell version: 1.4.0
url: test
connecting to: test
type "help" for help
> use drumbone
switched to db drumbone
> db.legislators.update({}, {$unset: {resolutions_sponsored: 1}}, false, true)
Invalid modifier specified $unset
>
@konklone
konklone / 1_extract_names.rb
Created April 28, 2010 15:17
Takes Sunlight's CSV of the House expenditures data and adds a bioguide_id column to it, filled in for each legislator in the House.
#!/usr/bin/env ruby
filename = ARGV.first
if filename.nil? or filename == ""
puts "Provide the filename of the CSV file with disbursement details as an argument."
exit
end
begin
## Methods dealing with Govtrack's KML exporter for states and congressional districts.
# Used to generate map files for a couple of Sunlight's projects, Politiwidgets and the
# Congress app for Android.
## You can also just download individual maps at GovTrack's page about all this:
# http://www.govtrack.us/embed/googlemaps.xpd
# This script is useful if you want to generate many programmatically.
# It also swaps out the default '0' placemark name for something minimally descriptive.
## This file isn't runnable, and just contains some methods.
<Grid x:Name="HouseSpinner" Background="Transparent" Margin="0,-80,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Canvas Grid.Column="0" RenderTransformOrigin="0.5,0.5" Width="120" Height="120">
<Canvas.RenderTransform>
<TransformGroup>
<ScaleTransform x:Name="SpinnerScale" ScaleX="0.3" ScaleY="0.3" />
@konklone
konklone / 51-android.rules
Created October 26, 2010 02:52
Android USB rules for Ubuntu Maverick/Natty with Nexus One and Galaxy Tab 10.1
# Meant for /etc/udev/rules.d/51-android.rules
# Google [*not* HTC] (i.e. Nexus One)
SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666"
# Samsung (i.e. Galaxy Tab)
SUBSYSTEM=="usb", SYSFS{idVendor}=="04e8", MODE="0666"
@konklone
konklone / video.json
Created November 9, 2010 20:42
Example video from the Real Time Congress API, as of 2010-11-09.
{"video":{
"duration":54300,
"legislative_day":"2010-09-29",
"timestamp_id":"1285743600",
"clip_urls":{
"wmv":"http://podcache-101.granicus.com/clerkhouse/clerkhouse_65407972-5a81-4441-b0d8-5bbdb7c969c1.wmv",
"mp3":"http://podcache-101.granicus.com/clerkhouse/clerkhouse_65407972-5a81-4441-b0d8-5bbdb7c969c1.mp3",
"mp4":"http://podcache-101.granicus.com/clerkhouse/clerkhouse_65407972-5a81-4441-b0d8-5bbdb7c969c1.mp4"
}
"clips":[{
@konklone
konklone / amendment.json
Created January 10, 2011 22:57
Real Time Congress API collection examples.
{
"amendments": [
{
"actions": [
{
"text": "Amendment SA 4843 proposed by Senator Bingaman for Senator Rockefeller.",
"acted_at": "2010-12-17T12:00:00Z",
"type": "action"
},
{
@konklone
konklone / database_fields.json
Created January 11, 2011 01:16
Real Time Congress API examples.
// /api/v1/bills.json?apikey=[yourKey]&sections=_id,bill_id
{
"bills": [
{
"_id": "4d288a0ee433b27bc6000006",
"bill_id": "hr217-112"
},
{
"_id": "4d288a0ee433b27bc6000001",
"bill_id": "hr212-112"
@konklone
konklone / activo.js
Created April 15, 2011 05:09 — forked from Rio517/file.rb
function breadcrumbs(options, callback) {
if (!options) options = {};
items = new NavigationBuilder();
if (callback)
callback(items);
...
}