This file contains hidden or 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
ProjectPages.Views.Projects ||= {} | |
class ProjectPages.Views.Projects.KeyMilestoneView extends Backbone.View | |
templates: | |
show: JST["backbone/templates/projects/key_milestones/show"] | |
edit: JST["backbone/templates/projects/key_milestones/edit"] | |
form: JST['backbone/templates/projects/key_milestones/_form'] | |
modalHeader: JST["backbone/templates/shared/modal/header"] | |
modalFooter: JST["backbone/templates/shared/modal/footer"] | |
This file contains hidden or 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
window.Story = Backbone.Model.extend({}); | |
window.Stories = Backbone.Collection.extend({ | |
model: Story, | |
url: 'https://www.facebook.com/feeds/page.php?id=347259993124&format=json&callback=?', | |
parse: function(response) { | |
console.log(response); | |
return response.entries; | |
} | |
}); |
This file contains hidden or 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
Sass::Engine.new(".GreenLight\n background-color: #0FF", :syntax => :sass).render | |
# returns => ".GreenLight {\n background-color: aqua; }\n" | |
# Is there a way to have Sass output #0FF instead of aqua? |
This file contains hidden or 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
# any way this could be a for loop in coffeescript too? | |
i = 0 | |
j = 2 | |
while i < 2 and j < 4 | |
alert i | |
alert j | |
i++ | |
j++ |
This file contains hidden or 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
info - socket.io started | |
25 Jun 21:09:25 - Server started on port 8124 | |
127.0.0.1 - - [Sun, 26 Jun 2011 01:09:32 GMT] "GET /require.js HTTP/1.1" 200 - "http://kriegspiel.carpeliam.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30" | |
debug - served static /socket.io.js | |
debug - client authorized | |
info - handshake authorized | |
info - handshaken 2411a4f640f1ac6684614b98bc7a95d5 | |
127.0.0.1 - - [Sun, 26 Jun 2011 01:09:33 GMT] "GET /favicon.ico HTTP/1.1" 404 - "" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30" | |
debug - setting request GET /socket.io/1/websocket/2411a4f640f1ac6684614b98bc7a95d5 | |
debug - publishing that 2411a4f640f1ac6684614b98bc7a95d5 connected |
This file contains hidden or 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
$.fn.nearest = function(selector) { | |
// base case if we can't find anything | |
if (this.length == 0) | |
return this; | |
var nearestSibling = this.prevAll(selector + ':first'); | |
if (nearestSibling.length > 0) | |
return nearestSibling; | |
return this.parent().nearest(selector); | |
}; |
This file contains hidden or 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
namespace :db do | |
desc "Clear all tables" | |
task :clear => :environment do | |
conn = ActiveRecord::Base.connection | |
conn.tables.select{|t| t.start_with? ActiveRecord::Base.table_name_prefix }.each do |t| | |
conn.drop_table t | |
end | |
end | |
desc "Dump database into an SQL file" |
This file contains hidden or 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 'spec_helper' | |
module ActionDispatch::Routing | |
describe Mapper do | |
context "#my_method_that_modifies_routes", :type => :routing do | |
before do | |
# do some stuff that alters the routes |
This file contains hidden or 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
module DealsHelper | |
def render_deals | |
Deal.all.collect do |deal| | |
content_tag :div, :class => 'deal' do | |
image_tag(deal.photo_url) | |
content_tag :h3, deal.title, :class => 'title' | |
content_tag :p, deal.full_price, :class => 'full_price' | |
content_tag :p, deal.selling_price, :class => 'selling_price' | |
content_tag :p, deal.discount, :class => 'discount' | |
content_tag :p, deal.store.name, :class => 'store_name' |
This file contains hidden or 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
<!-- app/views/project_roles/_form.html.erb --> | |
<div class="projectRole"> | |
<%= form.label :name %> | |
<%= form.text_field :name %> | |
<!-- etc etc etc --> | |
<!-- the JS down below relies on the following two lines being next to each other --> | |
<%= form.hidden_field '_destroy' unless form.object.new_record? %> | |
<a href="#" class="removeNestedItem">Delete</a> |