Skip to content

Instantly share code, notes, and snippets.

View seymores's full-sized avatar

Teo Choong Ping seymores

View GitHub Profile
@seymores
seymores / scala-2.9.1.final.rb
Created September 4, 2011 16:03
Homebrew formula to install Scala 2.9.1 final
require 'formula'
class ScalaDocs < Formula
homepage 'http://www.scala-lang.org/'
url 'http://www.scala-lang.org/downloads/distrib/files/scala-2.9.1.final-devel-docs.tgz'
version '2.9.1'
md5 'acb16cbdf46f682806f60b052707b7b7'
end
class Scala < Formula
/** E.g., UIColorFromRGB(0xE5E5E5) */
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
@seymores
seymores / androidmanifest_decompressor.groovy
Created May 24, 2011 07:19
AndroidManifest.xml decompressor
// decompressXML -- Parse the 'compressed' binary form of Android XML docs
// such as for AndroidManifest.xml in .apk files
int endDocTag = 0x00100101;
int startTag = 0x00100102;
int endTag = 0x00100103;
public void decompressXML(byte[] xml) {
// Compressed XML file/bytes starts with 24x bytes of data,
// 9 32 bit words in little endian order (LSB first):
// 0th word is 03 00 08 00