Skip to content

Instantly share code, notes, and snippets.

@tom--
tom-- / SillyWidget.php
Created June 19, 2012 00:32
A widget with actions
<?php
/**
* This package contains a widget class and two action method classes that the
* widget provides to the CController that uses it.
*
* The controller must register the actions provided by this widget as follows,
* in which we assume this package is in the 'extensions' directory under
* CWebApplication::$basePath
* <code>
@peterhellberg
peterhellberg / gfm.rb
Created March 18, 2012 17:51
GitHub Flavored Markdown parser for use with Jekyll and Marked.app
#!/usr/bin/env ruby
require 'rubygems'
require 'redcarpet'
require 'pygments.rb'
class HTMLwithPygments < Redcarpet::Render::HTML
def block_code(code, language)
Pygments.highlight(code, :lexer => language.to_sym, :options => {
:encoding => 'utf-8'
})