Public Gists by fnando

Gravatar
Wed Oct 28 19:53:48 -0700 2009
1
2
3
# set some constants
APP_DIRNAME = File.basename(root)
APP_NAME = APP_DIRNAME.classify
Gravatar
Wed Oct 28 17:11:10 -0700 2009
1
2
3
pt:
  date:
    formats:
Gravatar
Tue Oct 06 19:36:32 -0700 2009
1
2
3
module Bunny
  class Mock
    class << self
Gravatar
Thu Oct 01 09:14:29 -0700 2009
1
2
3
# Load cache from directory when using `config.action_controller.page_cache_directory` option.
# This metal will work on any server and you don't have to deal with mod_rewrite or something.
# To use it, place this file on app/metals/cache_loader.rb
Gravatar
Wed Sep 23 04:11:54 -0700 2009
1
2
3
# Specify which ruby version to use
# Here's how my ruby is installed:
#
Gravatar
Sun Sep 13 21:41:25 -0700 2009
1
2
3
pt:
  # date/time format
  date:
Gravatar
Fri Sep 11 12:18:49 -0700 2009
1
2
3
set :application, "myapp"
set :keep_releases, 5
 
gist: 171653 Open Saved URLs from Safari...
Gravatar
Thu Aug 20 21:14:44 -0700 2009
1
2
3
set theUrlList to {}
 
try
gist: 171641 Save all opened Safari URLs...
Gravatar
Thu Aug 20 20:50:30 -0700 2009
1
2
3
set theUrlsList to {}
 
tell application "Safari"
Gravatar
Mon Aug 17 08:42:50 -0700 2009
1
2
3
# By Henrik Nyh <http://henrik.nyh.se> 2008-01-30.
# Free to modify and redistribute with credit.
# Word truncation and fixes by Les Hill <http://blog.leshill.org> 2009-06-02
Gravatar
Sun Aug 02 14:48:49 -0700 2009
1
2
3
require "rubygems"
require "colorize"
require "time"
Gravatar
Sun Jul 19 16:00:30 -0700 2009
1
2
3
require "rubygems"
require "open-uri"
require "hpricot"
gist: 149540 /etc/fonts/fonts.conf for U...
Gravatar
Sat Jul 18 05:46:56 -0700 2009
1
2
3
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
Gravatar
Mon Jul 06 09:12:30 -0700 2009
1
2
3
# Extend ActiveRecord adding find_in_chunks method, that retrieves all records by making multiple queries, instead of Model.all
# which consumes lots of memory. This is specially great when you need to iterate a table for doing background jobs.
# The example below will query the database 10 times if it has 100 records, returning 10 records for each query.
Gravatar
Sun Jun 21 10:03:28 -0700 2009
1
2
3
tell application "Safari"
set current_url to URL of front document
do shell script "grabbit " & current_url
Gravatar
Sun Jun 21 09:21:33 -0700 2009
1
2
3
#!/usr/bin/env ruby
 
require "time"
Gravatar
Sat Jun 13 06:56:07 -0700 2009
1
2
3
$.normalizeTags = function(tags) {
    tags = tags.replace(/ +/gm, " ");
    
Gravatar
Fri May 15 06:27:21 -0700 2009
1
2
3
tell application "Terminal"
activate
 
gist: 78561 Place this file at /etc/ini...
Gravatar
Fri Mar 13 06:34:53 -0700 2009
1
2
3
#! /bin/sh
 
### BEGIN INIT INFO
Gravatar
Mon Mar 02 03:57:35 -0800 2009
1
2
3
// Created by Nando Vieira
String.prototype.normalize = function() {
var from = "àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŕŕ";