Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# my new favorite bashrc function | |
# quickly inspect source files in style | |
function pless { | |
pygmentize $1 | less -r | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sinatra' | |
require 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'mysql', | |
:encoding => 'utf8', | |
:database => 'foo', | |
:username => 'bar', | |
:password => 'baz', | |
:host => 'localhost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
OlderNewer