Skip to content

Instantly share code, notes, and snippets.

View vinniefranco's full-sized avatar
🏡
WFH

Vincent Franco vinniefranco

🏡
WFH
View GitHub Profile
@vinniefranco
vinniefranco / gist:1629828
Created January 17, 2012 23:47
Find files bigger than 10MB
find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
# Cool shit about Ruby
# Arrays
array1, array2 = %w{ x y z }, %w{ w y z }
array1 | array2 ###(Union) #=> ["x", "y", "z", "w"]
array1 & array2 ###(Intersect) #=> ["y", "z"]
array1 - array2 ###(Difference) #=> ["x"]
# Strings

Install GOSU prerequisites on Ubuntu 11.10

sudo apt-get install mesa-common-dev libsdl-ttf2.0-dev libopenal-dev libvorbis-dev libsndfile1-dev libfreeimage-dev

w = Widget.create({
"initalize" function() {
this.active_toggle = ".active_toggle";
}
"template": "widget_item",
"!change .active-toggle @is_active": function(is_active) {
// Update is_active status
this.active_toggle.prop("checked", is_active);
}
"inlineEditors(.item-title)": {
module MultiClip
def self.included( base )
base.extend( ClassMethods )
end
module ClassMethods
def has_attached_files( configs )
after_initialize :gen_subdirs
require 'yaml'
asset_path = File.expand_path(File.dirname(__FILE__) + '/../lib/assets/content/')
assets = Dir.glob(asset_path + '/*.yml')
assets.each do |url|
key = File.basename(url, '.yml')
parsed = YAML.load_file(url)
if parsed
klass = Admin.const_get(key.classify)
module AdminHelper
def link_to_direction(field)
title = field.humanize
dir = @order_dir == 'ASC' ? 'desc' : 'asc'
link_to title, yield(:order => field, :dir => dir) if block_given?
end
end
#
# Configuration File for JavaScript Lint 0.3.0
# Developed by Matthias Miller (http://www.JavaScriptLint.com)
#
# This configuration file can be used to lint a collection of scripts, or to enable
# or disable warnings for scripts that are linted via the command line.
#
### Warnings
# Enable or disable warnings based on requirements.
if (Array.prototype.map === undefined) {
Array.prototype.map = function(callback) {
var len = this.length;
if (typeof callback != "function") {
throw new TypeError();
}
var mapped = [len],
o = arguments[1];
for (var i = 0; i < len; i++) {
group :development, :test do
gem 'rspec-rails', '>= 2.5.0'
gem 'capybara'
gem 'launchy'
end
group :test do
gem 'cucumber-rails'
gem 'factory_girl_rails'
gem 'database_cleaner'