View gist:90ac0018f388088e1cdee0ba3743c88a
This file contains 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
(defn allowed-values [constraints] | |
(cond | |
(nil? constraints) (run* [q]) | |
(coll? constraints) (run* [q] (membero q constraints)) ;;<--works but not recursively | |
;;(coll? constraints) (run* [q] (first constraints)) | |
(keyword? constraints) (allowed-values (translate-symbol constraints)) | |
:else (run* [q] (== constraints q))) |
View gist:215a52c9b61d85bffa553a4fb009df30
This file contains 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
(ns temp | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:use [clojure.core.logic.pldb])) | |
(db-rel parent x y) | |
(db-rel male x) | |
(db-rel female x) | |
(defn child [x y] |
View designer.html
This file contains 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
<link rel="import" href="../paper-toast/paper-toast.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
View gist:6678596
This file contains 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
@config = YAML.load_file('config/config.yml')[ENV['environment'] ||= 'test'] |
View gist:6616630
This file contains 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
describe "let" do | |
let(:count) { @x = 0 } | |
let(:count_plus_1) { @x += 1} | |
it "memoizes the value" do | |
count.should == 0 | |
count_plus_1.should == 1 | |
end | |
it "is not cached across examples" do |
View gist:6584966
This file contains 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 Pusher | |
#initialization stuff | |
@config = information_about_queue_I_wish_to_monitor | |
Mqhelper::subscribe_to_queue(@config) do |delivery_info, properties, payload | | |
process payload | |
end | |
end | |
#Moving helps in the sense that my RSpec can directly call process, but my class is still listening to @config info |
View hubtest
This file contains 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 'rspec' | |
Given(/^a HubSpot monitor$/) do | |
@h = HubspotMonitor::HubMon.new | |
end | |
And(/^new contact info arriving$/) do | |
@h.stub(:dummy) {"New contact info"} | |
end |