Skip to content

Instantly share code, notes, and snippets.

View benmoss's full-sized avatar
🙈

Ben Moss benmoss

🙈
View GitHub Profile
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head>
<title>DataSift - Join our next Webinar</title>
<style type="text/css">
body {font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;}
a, p, h1, h2, h3, li {color:#555; font-family:'Helvetica Neue',Helvetica,Arial,sans-serif; font-weight:normal;}
a, p, li {font-size:13px; line-height:22px;}
a {color:#3399ff; display:inline; text-decoration:none;}
a:hover {text-decoration:underline !important;}
p {margin-top:0;}
@benmoss
benmoss / gist:6858141
Last active December 24, 2015 20:29 — forked from 1dolinski/gist:6858110
require 'spec_helper'
describe "Show page" do
subject { page }
describe "show page" do
let(:user) { create(:user) }
before { visit user_home_path}
it do
binding.pry
[18] pry(#<RSpec::Matchers::BuiltIn::Eq>)> DateTime.new(2000)
=> #<DateTime:0x0000000277a220>
[19] pry(#<RSpec::Matchers::BuiltIn::Eq>)> require 'date'
=> true
[20] pry(#<RSpec::Matchers::BuiltIn::Eq>)> DateTime.new(2000)
=> #<DateTime: 2000-01-01T00:00:00+00:00 (4903089/2,0,2299161)>
[1] pry(#<RSpec::Matchers::BuiltIn::Eq>)> show-source DateTime
From: /home/travis/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/date/format.rb @ line 1279:
Class name: DateTime
Number of lines: 35
class DateTime < Date
def strftime(fmt='%FT%T%:z')
super(fmt)
% 3 hi's, with an exception in the middle, and only two come out?
%%%%%%%%%%%%%%
1> self() ! hi.
hi
2> self() ! self ! hi.
** exception error: bad argument
in operator !/2
called as self ! hi
3> self() ! self() ! hi.
hi
class Post
belongs_to :poster, polymorphic: true
end
class User
has_many :posts, as: :poster
end
class Admin
has_many :posts, as: :poster
module ActiveModel
class Serializer
module Associations
class HasOne < Config
def root
if root = option(:root)
root
elsif polymorphic?
polymorphic_name.pluralize.to_sym
else
(def foo {})
;"Error evaluating:" (def foo {}) :as ".foo = cljs.core.PersistentArrayMap.EMPTY;\n"
;org.mozilla.javascript.EvaluatorException: syntax error (<cljs repl>#8)
;nil
(apply dom/table #js {:className "chess-board"}
(map #(dom/tr #js {:key (:position (first %))}
(om/build-all square % options))
rows))
; rows is structured as
; ((cursor cursor) (cursor cursor))
; want one TR per partition
class ScoutCommand
MissingKeyError = Class.new(ArgumentError)
attr_reader :node
def initialize(node)
@node = node
end
def to_s