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
From d6baaf8ed0f0cddbd311210042f3b91fa800b737 Mon Sep 17 00:00:00 2001 | |
From: Fabio Yamate <[email protected]> | |
Date: Mon, 3 Oct 2011 01:18:07 -0300 | |
Subject: [PATCH] Add checkboxes collection bootstrap. | |
--- | |
lib/simple_form/action_view_extensions/builder.rb | 7 ++++--- | |
lib/simple_form/components/labels.rb | 4 ++-- | |
lib/simple_form/inputs/boolean_input.rb | 8 ++++++-- | |
3 files changed, 12 insertions(+), 7 deletions(-) |
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
class Model < ActiveRecord::Base | |
has_attached_file :icon | |
has_removable_file :icon | |
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
# replaces all string matches in files | |
# | |
# USAGE: | |
# sr $from $to | |
# sr $from $to $type | |
# | |
# Arguments: | |
# $from - from value | |
# $to - to value | |
# $type - file type. DEFAULT: *.rb |
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
# Extract multiple rar files in subdirs from torrent files | |
# | |
# it doesn't extract files that have been previously. Always run the script file in | |
# the same dir as extrected.list, since it store path | |
# | |
# 1. ls **/*.rar - look up to any rar files in sub dirs | |
# 2. ignores all files that matches ones in the extracted.lst file | |
# 3. appends the non-extracted files to the lst file | |
# 4. for each rar file, extract them in the current directory | |
# |
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
Redis.new.tap { |redis| | |
["resque:delayed*", "resque:resque-retry*", "resque:failure_resque-retry*"].map { |rk| | |
redis.keys(rk).map { |k| redis.del(k) } | |
} | |
} |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>YUI Snippet</title> | |
<link rel="stylesheet" href="http://rawgithub.com/necolas/normalize.css/master/normalize.css"> | |
<script src="http://rawgithub.com/LeaVerou/prefixfree/gh-pages/prefixfree.min.js"></script> | |
</head> | |
<body> | |
<div id="container"></div> |
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
# Add an alias to your .bash_profile | |
# | |
# alias sjquery='curl https://raw.github.com/gist/2884873/jquery.html -L -o' | |
# alias sangular='curl https://raw.github.com/gist/2884873/angular.html -L -o' | |
# | |
# Updates: | |
# * using http://rawgithub.com service to include files directly from server | |
# | |
# Usage | |
# |
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 'pp' | |
require 'benchmark' | |
# compute all possible expressions to the given string of digits to a given set of operations. | |
# the digits are kept in order | |
# | |
# ex. 1234 | |
# generates: 1234, 1+234, 1-234, 12+34, 123-4... | |
# | |
# but selects only expressions that evaluate to a given value |
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 | |
# This is the 'mover' script used for moving files from the cache disk to the | |
# main array. It is typically invoked via cron. | |
# After checking if it's valid for this script to run, we check each of the top-level | |
# directories (shares) on the cache disk. If, and only if, the 'Use Cache' setting for the | |
# share is set to "yes", we use 'find' to process the objects (files and directories) of | |
# that directory, moving them to the array. |
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
source "https://rubygems.org" | |
gem "mongo", "~> 1.8.2" | |
gem "bson_ext", "~> 1.8.2" | |
gem "actionpack", "~> 3.2.12" |