Skip to content

Instantly share code, notes, and snippets.

View miguelsan's full-sized avatar
🌳
Starting up

Miguel San Miguel miguelsan

🌳
Starting up
View GitHub Profile
@miguelsan
miguelsan / slim.lang
Created April 9, 2011 01:23
slim.lang, a language_spec for syntax highlighting in gedit
<?xml version="1.0" encoding="UTF-8"?>
<!--
Author: Miguel San Miguel contact at miguelsanmiguel dotcom
Based on 'haml.lang' by Ivan Kerin
-->
<language id="slim" _name="Slim" version="1.0" _section="Rails">
<metadata>
<property name="mimetypes">text/x-slim</property>
<property name="globs">*.slim</property>
<property name="line-comment-start">/ </property>
require 'benchmark'
class Dummy
@VALID_OPTIONS = :first, :last, :all
class << self
def when_find(*args)
case args.first
when *@VALID_OPTIONS
@miguelsan
miguelsan / include_vs_when.rb
Created January 17, 2011 23:01 — forked from rafmagana/include_vs_when.rb
Improved benchmark to see which is faster, either when *array or array.include?
require 'benchmark'
class Dummy
class << self
def when_find(*args)
case args.first
when :first, :last, :all
send(args.first)
else