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
@lukemelia
lukemelia / config.ru
Created July 4, 2012 22:06
Example rack app for Ember development
require 'bundler/setup'
require 'sass'
require 'compass'
require 'rake-pipeline'
require 'listen'
require 'rack/lock'
require 'ruby-debug'
require 'securerandom'
require 'ruby_gntp'
@lukemelia
lukemelia / sketch.rb
Created June 23, 2012 20:01
sketch for Matt Wynne
class Organization
def to_param
"42"
end
def saved?
rand > 0.5
end
end
class OrganizationCreator
@lukemelia
lukemelia / Assetfile
Created June 20, 2012 04:04
Example rake-pipeline Assetfile
require "rake-pipeline-web-filters"
class ClosureFilter < Rake::Pipeline::Filter
def generate_output(inputs, output)
inputs.each do |input|
output.write "(function() { #{input.read} })()"
end
end
end
@lukemelia
lukemelia / config.ru
Created March 23, 2012 03:26
rake pipeline rack config
require 'bundler/setup'
require 'sass'
require 'compass'
require 'rake-pipeline'
require 'listen'
require 'rack/lock'
require 'ruby-debug'
require 'securerandom'
STDOUT.sync = true
@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##*:}
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'),
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}")
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`.
#
@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);
}
@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