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
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.2.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz | |
curl -L http://github.com/elasticsearch/elasticsearch-servicewrapper/tarball/master | tar -xz | |
sudo mv *servicewrapper*/service elasticsearch-0.20.2/bin/ |
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 concat | |
([] '()) | |
([x] x) | |
([x y] | |
(cons | |
(first x) | |
(lazy-seq | |
(if (empty? (rest x)) | |
(concat y) | |
(concat (rest 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
(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} |
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
#!/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
(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
; 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
(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
(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
(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))))) |
OlderNewer