Skip to content

Instantly share code, notes, and snippets.

@developernotes
developernotes / proguard.cfg
Created July 3, 2012 15:47
ProGuard with SQLCipher for Android
-libraryjars libs/commons-codec.jar
-libraryjars libs/guava-r09.jar
-libraryjars libs/sqlcipher.jar
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-dontobfuscate
package net.zetetic.tests;
import android.content.Context;
import android.database.Cursor;
import net.sqlcipher.database.SQLiteDatabase;
import net.sqlcipher.database.SQLiteOpenHelper;
import net.zetetic.ZeteticApplication;
public class ReadableWritableAccessTest extends SQLCipherTest {
@developernotes
developernotes / sample.c
Created June 7, 2012 19:07
Sampling PKCS5_PBKDF2_HMAC_SHA1 for adaptive cycles
#include <stdio.h>
#include <stdbool.h>
#include <pthread.h>
#include <semaphore.h>
#include <signal.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <openssl/hmac.h>
@developernotes
developernotes / gist:2669549
Created May 12, 2012 22:44
Script to print delete/create commands for Android AVD
android list avd | awk '/Name: /{print("android delete avd -n " $2)}'
android list targets | egrep "(android-)|(Name:)" | xargs -L 3 | grep "^id:" | awk '{print("android -s create avd -c 1000M -n emulator-" $7 " -t " $2)}'
@developernotes
developernotes / tango-2-theme.el
Created March 12, 2012 20:25
Tango 2 color theme for GNU Emacs 24
;;; tango-2-theme.el --- Tango 2 color theme for GNU Emacs 24
;; Author: Nick Parker
;; Version: 1.0.0
;;
;; Ported theme to Emacs 24 color theme Nick Parker <nickp@developernotes.com>
;; original from Will Farrington <wcfarrington@gmail.com>
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; published by the Free Software Foundation; either version 3 of
public class CrossProcessCursorWrapper extends CursorWrapper implements CrossProcessCursor {
public CrossProcessCursorWrapper(Cursor cursor) {
super(cursor);
}
@Override
public CursorWindow getWindow() {
return null;
}
@developernotes
developernotes / gist:1146913
Created August 15, 2011 14:53
kill diskimages-helper processes
ps -A | grep diskimages-helper | awk '{print $1}' | xargs kill -9
@developernotes
developernotes / gist:1015445
Created June 8, 2011 21:25
Enumeration extensions
public static void WhenNotNullPerform<TType, TResult>(this IEnumerable<TType> items, Func<TType, TResult> conditionToCheck, Action<TResult> actionToApply) where TResult : class
{
items.Each(x =>
{
var result = conditionToCheck.Invoke(x);
if (result != null)
{
actionToApply.Invoke(result);
}
});
@developernotes
developernotes / emacs-daemon.plist
Created April 2, 2011 20:50
Launch the emacs daemon at login
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>emacs-daemon</string>
<key>RunAtLoad</key>
<true/>
@developernotes
developernotes / brew-update-all.rb
Created December 26, 2010 17:43
Updates homebrew, installed packages and cleans up old packages
require 'utils'
class UpdateAll
def run
display("Updating homebrew and all installed packages, also cleaning up old packages:")
safe_system("brew update && brew upgrade && brew cleanup")
end
def display(message, &block)