Skip to content

Instantly share code, notes, and snippets.

View williamn's full-sized avatar

William williamn

  • Jakarta, Indonesia
View GitHub Profile
@williamn
williamn / git-training.md
Created October 21, 2011 07:54
Git and Github training topics

Git and Github training topics

  • What's Version Control
  • What's Git
  • Downloading and Installing Git
  • Create your local repository folder
  • Create your SSH Key
  • What's GitHub?
  • Set up your GitHub account
  • Creating a new repository
@williamn
williamn / sources.list
Created October 14, 2011 06:27
File sources.list bagi pengguna Ubuntu 11.04 yang menggunakan KAMBING.ui.ac.id sebagai mirror
## REPOSITORY UTAMA
deb http://kambing.ui.ac.id/ubuntu natty main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu natty main restricted universe multiverse
## INI UNTUK MAJOR BUG FIX UPDATES
deb http://kambing.ui.ac.id/ubuntu natty-updates main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu natty-updates main restricted universe multiverse
## INI UNTUK UBUNTU SECURITY UPDATES
deb http://kambing.ui.ac.id/ubuntu natty-security main restricted universe multiverse
deb-src http://kambing.ui.ac.id/ubuntu natty-security main restricted universe multiverse
@williamn
williamn / web_steps_id.rb
Created September 27, 2011 08:51
Cucumber-Rails built in steps in Bahasa Indonesia
# TL;DR: YOU SHOULD DELETE THIS FILE
#
# This file was generated by Cucumber-Rails and is only here to get you a head start
# These step definitions are thin wrappers around the Capybara/Webrat API that lets you
# visit pages, interact with widgets and make assertions about page content.
#
# If you use these step definitions as basis for your features you will quickly end up
# with features that are:
#
# * Hard to maintain
@williamn
williamn / web_steps_id.rb
Created September 27, 2011 02:48
Commonly used webrat steps in Bahasa Indonesia for in use with cucumber-rails 0.3.2
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
require 'uri'
require 'cgi'
require File.expand_path(File.join(File.dirname(__FILE__), "..", "support", "paths"))
@williamn
williamn / gist:1205500
Created September 9, 2011 04:29
Installing a gem in all your global RVM gemsets
# from http://blog.siyelo.com/installing-a-gem-in-all-your-global-rvm-gemse
for x in $(rvm list strings); do rvm use $x@global && gem install <RAD DEVELOPMENT GEM NAME>; done
@williamn
williamn / age1.sql
Created August 13, 2011 05:26
Find age SQL function
SELECT DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(dob, '%Y') - (DATE_FORMAT(NOW(), '00-%m-%d') < DATE_FORMAT(dob, '00-%m-%d')) AS age
@williamn
williamn / authentication.feature
Created August 11, 2011 14:45
Feature examples
Feature
In order to use the manage my church
As a user
I want to sign in and sign out
Scenario: Sign in
Given I am a non-authenticated user
When I go to "/login"
And I fill in "Email" with "admin@example.com"
And I fill in "Password" with "pass"
@williamn
williamn / kambing-updates.repo
Created August 4, 2011 05:22
File .repo Fedora bagi pengguna Kambing
[kambing-updates]
name=Fedora $releasever - $basearch - Updates
failovermethod=priority
baseurl=http://kambing.ui.ac.id/fedora/updates/$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch
@williamn
williamn / deploy.rb
Created July 25, 2011 01:42 — forked from josegonzalez/deploy.rb
Capistrano Deploy Script for CakePHP applications using GIT (update the $config hash)
$config = {
"application" => "DOMAIN.TLD",
"repository" => "git@GITHOST:USERNAME/REPOSITORYNAME.git",
"remoteusername" => "REMOTEUSERNAME",
"cake_folder" => "/PATH/TO/CAKE",
"cake_version" => "cakephp1.3",
"plugin_dir" => "plugins",
"servers" => {
"prod" => {
"server" => "APPLICATION.TLD",
@williamn
williamn / Number.php
Created July 20, 2011 04:56
Terbilang - Konversi bilangan menjadi kalimat dalam Bahasa Indonesia
<?php
class Number
{
function spell($number)
{
$words = array(
"", "Satu", "Dua", "Tiga", "Empat", "Lima", "Enam", "Tujuh",
"Delapan", "Sembilan", "Sepuluh", "Sebelas"
);