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
;; Example Machfile (https://github.com/juxt/mach) | |
;; Install: npm install -g @juxt/mach | |
;; Run: mach hibye | |
;; I'd like it to print hallo then bye, but it prints bye then hallo. | |
;; This is because it does a reverse topological sort. It would be | |
;; nice if it does a stable reverse topological sort instead, where | |
;; {depends [hallo bye]} would give a hint that the user wants hallo | |
;; to come before bye, even though there is no explicit dependency | |
{ |
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
### Keybase proof | |
I hereby claim: | |
* I am nberger on github. | |
* I am nberger (https://keybase.io/nberger) on keybase. | |
* I have a public key ASBeRgCRjkl58gDoHOR7-mRHVSh3dbVxa32dR48e0Nn4EAo | |
To claim this, I am signing this object: |
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 views.infinite-scroll | |
(:require | |
[reagent.core :as r])) | |
(defn- get-scroll-top [] | |
(if (exists? (.-pageYOffset js/window)) | |
(.-pageYOffset js/window) | |
(.-scrollTop (or (.-documentElement js/document) | |
(.-parentNode (.-body js/document)) | |
(.-body js/document))))) |
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 isorto.core-test | |
(:require [clojure.core.logic :as l :refer [run run*]] | |
[clojure.test :refer :all] | |
[isorto.core :refer [isorto]])) | |
(deftest isorto-test | |
(is (= [[]] | |
(run* [q] (isorto q ())))) | |
(is (= [[]] |
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 '[instaparse.core :as insta]) | |
(def parse | |
(insta/parser | |
"<moustache> = (tagged-block / word / sp)* | |
<tagged-block> = comment | section | var | |
comment = <tag-open> <'!'> (word | sp)* <tag-close> | |
section = section-block-open (current-item / var / comment / word / sp)* <section-block-close> | |
<section-block-open> = <tag-open> <'#'> name <tag-close> | |
section-block-close = tag-open '/' name tag-close |
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
; http://stackoverflow.com/questions/31269170/event-count-at-certain-time-interval-in-riemann | |
(let [email (mailer {:host "localhost" | |
:port 1025 | |
:from "[email protected]"})] | |
(streams | |
(where (and (service "system_log") | |
(description "IE") | |
(not (expired? event))) | |
; we are interested in the event count, so let's fix to :metric 1 |
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 recipes.core | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic] | |
[clojure.core.logic.pldb :as pldb])) | |
(db-rel in-larder i) | |
(db-rel recipe r) | |
(db-rel in-recipe r i) | |
(db-rel compound-ingredient i is) |
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
#!/usr/bin/env ruby | |
def current_branch() | |
branches = `git branch --no-color`.split(/\n/) | |
branches.select{ |b| b =~ /\s*\*/ }.first.gsub(/[\*\s]/, "") | |
end | |
branch = current_branch | |
if branch != "master" && branch !~ /^branches\// |
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 'test_helper' | |
require 'rantly/shrinks' | |
require 'rantly/testunit_extensions' | |
class PropertyShrinking < Test::Unit::TestCase | |
def setup | |
Rantly.gen.reset | |
end | |
should "be able to shrink an array of ints towards smaller int elements" 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
(ns server-cons.bench | |
(:require [server-cons.core :refer [allocate-machines allocate-machines*]])) | |
(def machines [{:id 1 :cpu-avg 22} | |
{:id 2 :cpu-avg 17} | |
{:id 3 :cpu-avg 6} | |
{:id 4 :cpu-avg 17} | |
{:id 5 :cpu-avg 6} | |
{:id 6 :cpu-avg 17} | |
{:id 7 :cpu-avg 6} |
NewerOlder