Skip to content

Instantly share code, notes, and snippets.

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'
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());
class ArtistSearchController < ApplicationController
def search
@title = "Search"
end
def artist
@title = "Similar artists"
logger.debug "#{params[:artist].class}"
unless params.nil?
musicRequest = MusicRequest.new
<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>
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=[]
@levinotik
levinotik / gist:1469918
Created December 13, 2011 01:07
device controller
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}
**pages; /* lazy-loaded pages */
fz_glyph_cache *gl
#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]);
}
#!/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
s = "http://s3.amazonaws.com/rails3_production/mugshots/images/1368905/original_open-uri20120131-988-wwa1lh.?1328048437"
if s =~ /(open.+[\z^.*?])/ix
puts $1 end