Skip to content

Instantly share code, notes, and snippets.

View rafi's full-sized avatar

Rafael Bodill rafi

View GitHub Profile
@rafi
rafi / gource-commands.txt
Created April 14, 2010 15:26 — forked from alkavan/gource-commands.txt
Gource command
################################
gource commands
################################
# basic command for big and long projects
gource --max-user-speed 500 --seconds-per-day 0.05 --file-idle-time 10 -e 0.005 -f --max-files 300 --hide-files
# some easy to understand commands
# for output file
--output-ppm-stream ~/ppm/ppm-kohana
@rafi
rafi / hipchat_bitlbee.md
Last active January 1, 2016 12:39 — forked from taylor/HOWTO-bitlbee+hipchat.mkd
Connect to HipChat with bitlbee

HipChat with bitlbee

Initial setup

  • account add jabber USERNAME@chat.hipchat.com 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on

Listings

  • For nicks /join &hipchat
<?php
Trait MethodDelegator
{
private $roles = array();
private $method_map = array();
public function delegate($class)
{
@rafi
rafi / json.php
Created June 12, 2011 20:03 — forked from alkavan/json.php
JSON Helper for Kohana v3.x
<?php defined('SYSPATH') or die('No direct script access.');
/**
* JSON helper class
*
* Examples:
* $j = JSON::decode('{"Organization": "Kohana"}'); // Good
* $j = JSON::decode("{'Organization': 'Kohana'}"); // Invalid
* $j = JSON::decode('{"Organization": "Kohana"}', NULL, 1); // depth stack exceeded
*
* @package Kohana
diff --git a/classes/kohana/exception.php b/classes/kohana/exception.php
index 7952a7b..657f661 100644
--- a/classes/kohana/exception.php
+++ b/classes/kohana/exception.php
@@ -23,6 +23,8 @@ class Kohana_Exception extends Exception {
*/
public function __construct($message, array $variables = NULL, $code = 0)
{
+ $variables = array_map(array('HTML', 'chars'), $variables);
+
@rafi
rafi / tree.php
Created April 15, 2010 10:33 — forked from shadowhand/tree.php
Tree view
<?php
$depth = 0;
echo '<ol class="tree">';
foreach ($children as $i => $child)
{
// Get the last and next nodes
$last = isset($children[$i-1]) ? $children[$i-1] : $children[0];
$next = isset($children[$i+1]) ? $children[$i+1] : $children[0];
javascript:(function() {
var bookmarklet = {
init: function() {
this.parse();
},
parse: function() {
page = "";
$(".PlaylistPage:visible")
.find(".Track")
.children(".info")