Skip to content

Instantly share code, notes, and snippets.

View mineiro's full-sized avatar

José Netto mineiro

View GitHub Profile
# my new favorite bashrc function
# quickly inspect source files in style
function pless {
pygmentize $1 | less -r
}
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

--- a/src/configure.in
+++ b/src/configure.in
@@ -993,11 +993,17 @@ AC_ARG_ENABLE(rubyinterp,
AC_MSG_RESULT($enable_rubyinterp)
if test "$enable_rubyinterp" = "yes"; then
AC_MSG_CHECKING(--with-ruby-command argument)
+ dnl If a ruby command was provided, set RUBY_CMD to the name of the binary and RUBY_PATH to its directory
AC_ARG_WITH(ruby-command, [ --with-ruby-command=RUBY name of the Ruby command (default: ruby)],
- RUBY_CMD="$withval"; AC_MSG_RESULT($RUBY_CMD),
- RUBY_CMD="ruby"; AC_MSG_RESULT(defaulting to $RUBY_CMD))
@viniciusteles
viniciusteles / gist:556029
Created August 29, 2010 06:20
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
@gma
gma / app.rb
Created September 27, 2010 17:21
Enabling article dates in Nesta URLs
# This code enables URLs with dates in for pages that have date set.
#
# If you use this code then a page published on 27 September 2010 with a path
# (relative to Nesta's content directory) of /foo/bar will now be available
# from /2010/09/07/foo/bar.
#
# Installation:
#
# $ mkdir -p local
# $ cat >> local/app.rb # (paste the following code, then press ^D)
@gma
gma / app.rb
Created September 28, 2010 15:54
# To redirect to your latest article when somebody hits the home page
# of your Nesta site, try this:
#
# $ mkdir -p local
# $ cat >> local/app.rb # then paste in this code and type Ctrl-D
get "/" do
latest = Page.find_articles[0]
redirect latest.abspath
end
require 'sinatra'
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => 'mysql',
:encoding => 'utf8',
:database => 'foo',
:username => 'bar',
:password => 'baz',
:host => 'localhost'
@dansimau
dansimau / ldif-to-csv.sh
Created November 12, 2010 15:14
Shell script that reads LDIF data from STDIN and outputs as CSV.
#!/bin/bash
#
# Converts LDIF data to CSV.
# Doesn't handle comments very well. Use -LLL with ldapsearch to remove them.
#
# 2010-03-07
# dsimmons@squiz.co.uk
#
# Show usage if we don't have the right params
@jcroft
jcroft / grid.sass
Created March 21, 2011 18:09
The grid component from my personal front-end framework. Brief demo here: http://jeffcroft.com/static/misc/grid_frameworks.mov
// REQUIRED VARS. Defaults to a 950px wide, 24-column grid that has 30px wide units and 10px wide
// gutters. If you do the fluid grid, then this 950/24/30/10px size will become the maximum size.
$grid_type: fixed !default
$grid_columns: 24 !default
$grid_column_width: 30 !default
$grid_gutter_width: 10 !default
// GENERATED VARS. You can ignore these.
$grid_full_width: $grid_columns * $grid_column_width + $grid_columns * $grid_gutter_width - $grid_gutter_width
$grid_column_width_percent: ($grid_column_width / $grid_full_width * 100) * 1%
module Test
module Unit
TestCase = RSpec::Core::ExampleGroup
end
end
class Test::Unit::TestCase
def self.inherited(host)
host.set_it_up host.name.gsub(/(Spec|Test)/,'')
def host.method_added(name)