Skip to content

Instantly share code, notes, and snippets.

View scottferg's full-sized avatar

Scott Ferguson scottferg

  • Numerator/InfoScout
  • Chicago, IL
View GitHub Profile
import git
import sys, os
import getopt
findParentCommit = lambda x: x.data[53:93]
def parseFileList(diff):
'''Parses filenames out of a diff'''
result = []
def _getFormattedDiffBuffer(self, commit):
'''
Formats a commit diff message with proper styling
'''
textBuffer = gtk.TextBuffer()
textBuffer.set_text(commit)
startIter, endIter = textBuffer.get_bounds()
# Setup text formatting tags
var DIMENSION = 20;
var board;
var context;
var boardState = new Array(18);
function drawRPGBoard() {
board = document.getElementById('board');
context = board.getContext('2d');
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
import urllib
import urllib2
import re
from urllib2 import URLError, HTTPError
error = None
wave = None
auth = None
import pygtk
pygtk.require("2.0")
import gtk
import gtk.glade
import gobject
import cairo
import math
# Create a GTK+ widget on which we will draw using Cairo
package com.myapp.mobile;
import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.view.View;
import android.util.Log;
import java.net.URL;
import java.net.URLEncoder;
package com.myapp.mobile;
public class Singleton
{
private static Singleton instance = null;
protected Singleton()
{
// Exists only to defeat instantiation
}
// List which columns we want to retrieve
String[] projection = new String[] {
Phones._ID,
Phones.NAME,
Phones.NUMBER
};
// Query the content provider
Cursor managedCursor = managedQuery(Phones.CONTENT_URI, // URI path
projection, // Which columns to fetch
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="@+id/widget51"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android"
>
<TextView
android:id="@+id/widget40"