Skip to content

Instantly share code, notes, and snippets.

View 13k's full-sized avatar

K 13k

View GitHub Profile
<?php
require_once 'util.php';
class Application_Model_Abstract
{
public function __construct(array $options = null)
{
if (is_array($options)) {
$this->setFromArray($options);
<?php
/***
* Helper functions to convert strings:
* - from CamelCase to camel_case and;
* - from under_score to UnderScore
*
* These are very probably not fast (or the fastest version).
***/
#!/usr/bin/env python
# If Win32, MSYS/cygwin with sed is required
import sys
if __name__ != '__main__':
print "This script must be run, not imported"
sys.exit(1)
try:
= Christian Neukirchen's Ruby Style Guide
[ http://github.com/chneukirchen/styleguide/blob/master/RUBY-STYLE ]
You may not like all rules presented here, but they work very well for
me and have helped producing high quality code. Everyone is free to
code however they want, write and follow their own style guides, but
when you contribute to my code, please follow these rules:
== Formatting:
#!/usr/bin/ruby
require 'optparse'
def read_paths_from_file(file)
File.new(file).readlines.map(&:strip)
end
def request_params(path, method = :get)
ActionController::Routing::Routes.recognize_path(path, {:method => method})
# see it in action: http://yfrog.com/49ydhp
minimal_prompt_command() {
if [ $? -eq 0 ]; then
local ARROW_COLOR="\[\e[1;32m\]"
else
local ARROW_COLOR="\[\e[1;31m\]"
fi
local CWD_GIT_BRANCH="`git symbolic-ref HEAD 2> /dev/null | sed -e 's#refs/heads/##'`"
PS1="\n\[\e[1;30m\] +\[\e[0m\] \[\e[1;34m\]\w\[\e[1;37m\] $CWD_GIT_BRANCH\[\e[0m\]\n$ARROW_COLOR~>\[\e[0m\] "

HTC G1/Dream boot

Here is a set of useful files (NOT FOR HTC MAGIC)

http://rapidshare.com/files/388568285/g1boot.zip

MD5: 5cf401e6f1294917047205bd483e0c74

  • hboot: 1.33.2003 - SPL both in update.zip and img format
  • hboot: 1.33.2005 - in img format
function prefix_with_bundler() {
[ -f Gemfile ] && pre="bundle exec" || pre=""
$pre "$@"
}
alias rbe='prefix_with_bundler'
alias rsv='rbe thin start'
alias rup='rbe rackup -s thin'
alias rcon='[ -f Gemfile ] && rails="bundle exec rails" || rails=`which rails 2> /dev/null`; [ -z "$rails" ] && : || $rails --version | cut -d" " -f2 | grep -q "^3" && $rails console || script/console'
alias bundle1='bundle _1.0.0_'
require 'rubygems'
require 'thor'
require 'active_support/core_ext/hash'
h1 = {:a => 1}
# => {:a=>1}
h2 = Thor::CoreExt::HashWithIndifferentAccess.new(:a => 2)
# => {"a"=>2}
alias rake='rake --trace'