Skip to content

Instantly share code, notes, and snippets.

Avatar
🎸
Working from home

Jose Diaz-Gonzalez josegonzalez

🎸
Working from home
View GitHub Profile
@josegonzalez
josegonzalez / Readme.textile
Created Nov 19, 2009
CakePHP Shell to calculate CodeBaseHQ time using git commit messages
@josegonzalez
josegonzalez / searchable.php
Created Mar 22, 2010
One of many iterations on a helper for the Searchable plugin
View searchable.php
<?php
class SearchableHelper extends AppHelper {
var $helpers = array('Html', 'Text');
function snippets($data) {
$data = json_decode($data, true);
$term = (isset($this->data['SearchIndex']['term'])) ? trim($this->data['SearchIndex']['term']) : '';
$snippets = '';
while (strlen($snippets) < 255 && $value = next($data)) {
$snippets .= $this->Text->highlight($this->Text->excerpt($value, $term, 20), $term);
View love.php
b30d30e56991fe459c2292783185769bbe57f7da8f5b84d6934640263ec9b170258c8ff39556368ae50e5a629d657d4d0d7cf2976b0214c6abc9370711257d82
@josegonzalez
josegonzalez / app_helper.php
Created Apr 24, 2010
AppHelper replacement to use named urls like @prefix_plugin_controller_action
View app_helper.php
<?php
/**
* Short description for file.
*
* This file is application-wide helper file. You can put all
* application-wide helper-related methods here.
*
* PHP versions 4 and 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
@josegonzalez
josegonzalez / category.rb
Created Aug 14, 2010
Category plugin for Jekyll
View category.rb
module Jekyll
class CategoryIndex < Page
def initialize(site, base, dir, category)
@site = site
@base = base
@dir = dir
@name = 'index.html'
self.process(@name)
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
View .gitconfig
[user]
name = MY_NAME
email = MY_EMAIL_ADDRESS
[git-tmbundle]
gitnub-path = /Applications/GitNub.app
gitx-path = /Applications/GitX.app
show-diff-check = yes
[github]
user = GITUB_USER
token = GITHUB_TOKEN