Skip to content

Instantly share code, notes, and snippets.

View lukemelia's full-sized avatar
💭
Making Yapp better all the time and likely working on some Ember.js OSS

Luke Melia lukemelia

💭
Making Yapp better all the time and likely working on some Ember.js OSS
View GitHub Profile
➜ ~ rvm install ree --enable-shared --with-readline-dir=$HOME/.rvm/usr --patch readline-fix --with-iconv-dir=$rvm_path/usr --trace >outfile 2>stderr
➜ ~ cat outfile
ree --enable-shared --with-readline-dir=/Users/lmelia/.rvm/usr --patch readline-fix --with-iconv-dir=/Users/lmelia/.rvm/usr --trace
rvm 1.6.5 by Wayne E. Seguin ([email protected]) [https://rvm.beginrescueend.com/]
Installing Ruby Enterprise Edition from source to: /Users/lmelia/.rvm/rubies/ree-1.8.7-2011.03
ree-1.8.7-2011.03 - #fetching (ruby-enterprise-1.8.7-2011.03)
Applying patch 'readline-fix' (located at /Users/lmelia/.rvm/patches/ree/1.8.7/readline-fix.diff)
➜ ~ rvm install ree
Installing Ruby Enterprise Edition from source to: /Users/lmelia/.rvm/rubies/ree-1.8.7-2011.03
ree-1.8.7-2011.03 - #fetching (ruby-enterprise-1.8.7-2011.03)
/Users/lmelia/.rvm/scripts/functions/logging: line 14: printf: --: invalid option
printf: usage: printf [-v var] format [arguments]
ree-1.8.7-2011.03 - #installing
Removing old Rubygems files...
Installing rubygems dedicated to ree-1.8.7-2011.03...
Installing rubygems for /Users/lmelia/.rvm/rubies/ree-1.8.7-2011.03/bin/ruby
Installation of rubygems completed successfully.
@lukemelia
lukemelia / databases.rake
Created May 23, 2011 20:35
Our replacement for schema.rb dump/load
namespace :db do
namespace :structure do
desc "Dump the database structure to a SQL file"
task :dump => :load_config do
config = ActiveRecord::Base.configurations[Rails.env]
command = "mysqldump -u #{config["username"]} #{config["database"]} --no-data --skip-comments --skip-add-drop-table > db/#{Rails.env}_structure.sql"
puts "Running: #{command}"
system command
diff --git a/lib/caching_presenter.rb b/lib/caching_presenter.rb
index 0b11077..4578511 100644
--- a/lib/caching_presenter.rb
+++ b/lib/caching_presenter.rb
@@ -33,7 +33,11 @@ class CachingPresenter
@cached_instance_methods = Hash.new{ |h,k| h[k] = {}}
write_constructor :presents => @presents, :options => options
%w(class id to_param).each do |method|
- undef_method method if respond_to?(method)
+ begin
@lukemelia
lukemelia / index.rb
Created July 11, 2011 18:25 — forked from nesquena/index.rb
Example of using extends
object @posts
attributes :id, :title, :created_at
child :user do
extends "users/show"
end
@lukemelia
lukemelia / gist:1181708
Created August 30, 2011 18:58
classNameBindings patch
diff --git a/frameworks/core_foundation/views/view.js b/frameworks/core_foundation/views/view.js
index 9232a48..9384422 100644
--- a/frameworks/core_foundation/views/view.js
+++ b/frameworks/core_foundation/views/view.js
@@ -725,12 +725,14 @@ SC.CoreView.reopen(
// If we had previously added a class to the element, remove it.
if (oldClass) {
elem.removeClass(oldClass);
+ classNames.removeObject(newClass);
}
require 'guard'
require 'guard/guard'
require 'guard/watcher'
require 'tempfile'
module Guard
# The CoffeeScript guard that gets notifications about the following
# Guard events: `start`, `stop`, `reload`, `run_all` and `run_on_change`.
#
symlinks_to_materialize.each do |symlink|
source = print_and_execute("readlink #{symlink}").chomp
source = File.expand_path(symlink + "/../" + source)
source_type = `file #{source} `.chomp.split(':')[1].strip().to_sym
print_and_execute("rm #{symlink}")
case source_type
when :directory
print_and_execute("cp -R #{source} #{symlink}")
when :file
print_and_execute("cp #{source} #{symlink}")
App.ProjectSelectView = Ember.CollectionView.extend({
selected: null,
itemViewClass: Ember.View.extend({
attributeBindings:['selected'],
valueBinding: 'content.selected'
}),
valueChanged: function(){
this.$().val( this.get('selected') );
}.observes('selected'),
@lukemelia
lukemelia / gist:1683235
Created January 26, 2012 15:19
mate_to_line
#!/bin/bash
# Open /path/to/file:5 in textmate on line 5
exec mate ${1%%:*} -l${1##*:}