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))) |
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] |
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%; |
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'] |
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 |
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 |
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 |