View solution.ex
defmodule Brainluck do
defstruct data: <<0>>, data_pointer: 0,
output: <<>>,
instructions: "", inst_pointer: 0,
input: <<>>,
skip_depth: 0,
block_stack: []
def brain_luck(program, inputs) do
%Brainluck{instructions: program, input: inputs} |> process
View apple_record.rb
class AppleRecord < Record
end
View pre-commit
#!/usr/bin/env ruby
# vim: set syntax=ruby
begin
require 'colorize'
rescue LoadError
class String
def fake_color(*)
self
end
View Engine.rb
require 'jade'
module ResourceBrowser
class Engine < ::Rails::Engine
isolate_namespace ResourceBrowser
config.assets.enabled = true
end
end
View index.html.haml
%h1.page-heading= "Rating Panels for #{@image.name}"
- if @image.rating_panels.empty?
.alert no rating panels for this image
- @image.rating_panels.each do |panel|
.row-fluid.panel-listing
%h1= panel.name
%p= panel.description
%hr
View board.rb
require "ffi/aspell"
module Soggle
class Board
attr_reader :height, :width
def initialize(board,speller=::FFI::Aspell::Speller.new("en_US"))
@board=parse(board)
@width=@board.first.length
@height=@board.length
View api_routing_spec.rb
require 'spec_helper'
describe Api do
describe "routing" do
it "routes to entry point" do
['1','v1'].each do |version_spec|
get("api/#{version_spec}").should route_to 'api/v1/entry_point#index'
end
end
end
View base_transaction.rb
module CheetahCub
class Transaction
attr_reader :transaction_delegate
delegate :save, to: :transaction_delegate
# def save
# transaction_delegate.save
# end
def initialize
@transaction_delegate = Config.module_prefix::Transaction.new
end
View gist:3914787
Error: A method named '/users/insert' is already defined
at app/packages/livedata/livedata_server.js:843:15
at Function._.each._.forEach (app/packages/underscore/underscore.js:84:24)
at _.extend.methods (app/packages/livedata/livedata_server.js:841:7)
at Meteor.Collection._defineMutationMethods (app/packages/mongo-livedata/collection.js:379:19)
at new Meteor.Collection (app/packages/mongo-livedata/collection.js:104:8)
at app/server/users.coffee.js:3:9
at /Users/cableray/Dev/meteor/fae_chess/.meteor/local/build/server/server.js:107:21
at Array.forEach (native)
at Function._.each._.forEach (/Users/cableray/Dev/meteor/fae_chess/.meteor/local/build/server/underscore.js:76:11)
View antvatar_part_category.rb
FactoryGirl.define do
factory :antvatar_part_category do
sequence(:name) {|n| "Category #{n}"}
trait :current_seasonal do
started_on {1.week.ago}
stopped_on {1.week.from.now}
end
trait :sesonal_ended do
stopped_on {1.week.ago}
end