Skip to content

Instantly share code, notes, and snippets.

View brk3's full-sized avatar
😮‍💨

Paul Bourke brk3

😮‍💨
View GitHub Profile
private List<SerializablePath> mAddedFPPaths = new ArrayList<SerializablePath>();
public void loadState() {
try {
FileInputStream fis = mContext.openFileInput(STATE_DATA);
ObjectInputStream ois = new ObjectInputStream(fis);
try {
mAddedFPPaths = (ArrayList<SerializablePath>)ois.readObject();
n = '1000000'
r = list(n)
r.reverse()
ret = []
for i,j in enumerate(r):
if i % 3 == 0 and i != 0:
ret.append(',')
@brk3
brk3 / change_knife
Last active December 11, 2015 17:19
Quick tool to manage Chef knife configuration
#!/usr/bin/python
import os
import sys
chefdir = os.path.join(os.getenv('HOME'), '.chef')
if len(sys.argv) != 2:
print 'Usage: change_knife [-l|env]'
exit(1)
@brk3
brk3 / pom.xml
Created February 18, 2013 22:45
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany.app</groupId>
<artifactId>my-app</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>my-app</name>
<url>http://maven.apache.org</url>
<dependencies>
package com.bourke.roidrage;
import android.content.res.Resources;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Typeface;
import android.graphics.BitmapFactory;
import android.graphics.Paint;
import android.graphics.Color;
@brk3
brk3 / gist:6072990
Created July 24, 2013 18:08
Test your flickrj-android app during a simulated API outage
diff --git a/flickrj-android/pom.xml b/flickrj-android/pom.xml
index 9371c9a..88884f8 100644
--- a/flickrj-android/pom.xml
+++ b/flickrj-android/pom.xml
@@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode.flickrj-android</groupId>
<artifactId>flickrj-android</artifactId>
- <version>2.0.8-SNAPSHOT</version>
+ <version>2.0.8-BROKEN</version>
@brk3
brk3 / PicassoHelper.java
Created November 30, 2013 19:52
Singleton to manage and access Picasso cache
package com.bourke.glimmr.common;
import android.content.Context;
import com.squareup.picasso.LruCache;
import com.squareup.picasso.Picasso;
public class PicassoHelper {
private static final String TAG = "Glimmr/PicassoHelper";
$ buck build plugins:core
Buck is at 2b80cf780ae31bee6609ebc1bbab9ce6fd004dbe,
but should be 274acb17e9b6dc9ee60bc1371c47a7f49640c24c.
Buck is updating itself.
To disable this, add a '.nobuckcheck' file to your project root.
In general, you should only disable this if you are developing Buck.
Previous HEAD position was 2b80cf7... Make sure StepFailedException includes full description.
HEAD is now at 274acb1... Allow system wide or user specific configurations
Buildfile: /home/bourke/sandbox/buck/build.xml
Tail = require('tail').Tail;
tail = new Tail("foo.txt");
tail.on("line", function(data) {
console.log(data);
});
tail.on("line", function(data) {
console.log(data);
});
#!/bin/bash
if ! [ $# -eq 1 ]; then
echo "Usage: $0 <node-name>"
exit 1
fi
# Make sure you have all dependencies:
# yum -y install libguestfs-tools virt-install