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
Failures: | |
1) PagesController GET 'home' should be successful | |
Failure/Error: get 'pages/home' | |
ActionController::RoutingError: | |
No route matches {:controller=>"pages", :action=>"pages/home"} | |
# ./spec/controllers/pages_controller_spec.rb:8:in `block (3 levels) in <top (required)>' | |
2) PagesController GET 'about' should be successful | |
Failure/Error: get 'pages/about' |
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
Function.prototype.method = function(name, func) { | |
this.prototype[name] = func; | |
return this; | |
}; | |
Number.method('integer', function() { | |
return Math[this < 0 ? 'ceiling' : 'floor'](this); | |
}); | |
document.writeln((-10 / 3).integer()); |
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
class ArtistSearchController < ApplicationController | |
def search | |
@title = "Search" | |
end | |
def artist | |
@title = "Similar artists" | |
logger.debug "#{params[:artist].class}" | |
unless params.nil? | |
musicRequest = MusicRequest.new |
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
<div> | |
<table> | |
<% @similar_artists.each do |artist| %> | |
<tr><td><%= image_tag(@artist_image, :alt => "artist image") %></td></tr> | |
<tr><td><%= artist %></td></tr> | |
</table> | |
<% end %> | |
</div> |
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
class User < ActiveRecord::Base | |
validate :fb_id, :uniqueness => true, :presence => true | |
has_many :ratings | |
serialize :followed_users, Array | |
def initialize(params={}) | |
super(params) | |
self.score=0 | |
self.followed_users=[] |
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
class DevicesController < ApplicationController | |
# GET /devices | |
# GET /devices.xml | |
def index | |
@devices = Device.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.xml { render :xml => @devices } | |
format.json { render :json => @devices} |
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
**pages; /* lazy-loaded pages */ | |
fz_glyph_cache *gl |
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
#include <stdio.h> | |
#define IN 1 | |
#define OUT 0 | |
int main(int argc, char *argv[]) { | |
int arg; | |
for(arg = 0; arg < argc; arg++) { | |
puts(argv[arg]); | |
} |
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
#!/usr/bin/env ruby | |
#Author - Levi Notik | |
# Pass the root project path in which to see | |
# which Activities you've forgotten to add to your manifest | |
@activities = Array.new | |
@project_files = Array.new |
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
s = "http://s3.amazonaws.com/rails3_production/mugshots/images/1368905/original_open-uri20120131-988-wwa1lh.?1328048437" | |
if s =~ /(open.+[\z^.*?])/ix | |
puts $1 end |