Skip to content

Instantly share code, notes, and snippets.

View nickel's full-sized avatar
🎩

Juan Gallego IV nickel

🎩
View GitHub Profile
#bash_profile:
alias reload='source ~/.bash_profile'
alias ll="ls -l"
alias la="ls -a"
alias lla="ls -la"
alias rm='rm -i'
alias srm='srm -i'
alias m=more
alias ..="cd .."
alias l="ls -AFhl"
# make bash autocomplete with up arrow
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
module ActionView
module Helpers
module UrlHelper
def button_to(name, options = {}, html_options = {})
html_options = html_options.stringify_keys
convert_boolean_attributes!(html_options, %w( disabled ))
method_tag = ''
if (method = html_options.delete('method')) && %w{put delete}.include?(method.to_s)
method_tag = tag('input', :type => 'hidden', :name => '_method', :value => method.to_s)
@nickel
nickel / gist:39679
Created December 24, 2008 12:56
.bash_profile
#bash_profile:
alias reload='source ~/.bash_profile'
alias ll="ls -l"
alias la="ls -a"
alias lla="ls -la"
alias rm='rm -i'
alias srm='srm -i'
alias m=more
alias ..="cd .."
alias l="ls -AFhl"
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
require 'active_resource/http_mock'
class Test::Unit::TestCase
self.use_transactional_fixtures = true
self.use_instantiated_fixtures = false
def self.all_fixtures
class PagesController < ApplicationController
verify :params => :name, :only => :show, :redirect_to => :root_path
before_filter :set_locale, :ensure_valid, :only => :show
def show
render :template => "pages/#{current_page}"
end
protected
module SimpleCachingTTL
CACHETIME = 24 * 3600 # Once per day
def cache(text, path)
FileUtils.mkdir_p(File.dirname(path))
File.open(path, 'w') { |f| f.write( text ) }
text
end
static:
controller: pages
action: show
view: name # El parametro que indica el nombre del contenido estático.
default:
keywords: "charifuflis"
en:
title: I need my seo, dear web developer
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
# 14 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
#! /usr/bin/env ruby
if ARGV[0].nil? || ARGV[1].nil?
puts "Error. Uso: #{$0} wmv_folder/ flv_folder/"
end
Dir.open(ARGV[0]).entries.sort.each do |entry|
if [".", ".."].include? entry
next
end