This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var DIMENSION = 20; | |
var board; | |
var context; | |
var boardState = new Array(18); | |
function drawRPGBoard() { | |
board = document.getElementById('board'); | |
context = board.getContext('2d'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ***** 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import urllib2 | |
import re | |
from urllib2 import URLError, HTTPError | |
error = None | |
wave = None | |
auth = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.myapp.mobile; | |
public class Singleton | |
{ | |
private static Singleton instance = null; | |
protected Singleton() | |
{ | |
// Exists only to defeat instantiation | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class required_parameter(object): | |
def __init__(self, paramName): | |
self.paramName = paramName | |
def __call__(self, function): | |
def error(param): | |
return HttpResponse('Required parameter %s not provided' % param) | |
def wrapped_f(*args): | |
if (self.paramName in args[0].REQUEST.keys() and args[0].REQUEST.get(self.paramName)): |