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
deploy_revision "/opt/myapp/deploy" do | |
scm_provider Chef::Provider::Git | |
repo "git@github.com:MyCompany/awesome.git" | |
revision "master" | |
user "myappuser" | |
group "myappgroup" | |
# ... pre/post actions | |
end |
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
;; code from Austin Clojure Meetup light table live coding | |
;; implement union alogrithm from Sedgewick/Wayne class | |
;; -- https://class.coursera.org/algs4partI-2012-001/ | |
;; lecture notes week 1 - https://d19vezwu8eufl6.cloudfront.net/algs4partI/slides%2F15UnionFind.pdf | |
;; every state has a unique group id | |
(def no-connections | |
[0 1 2 3 4 5 6 7 8 9]) | |
;; two states are connected if they have the |
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
val test1a = [ | |
all_except_option("foo", []) = NONE, | |
all_except_option("foo", ["bar"]) = NONE, | |
all_except_option("foo", ["foo"]) = SOME([]), | |
all_except_option("foo", ["foo","x","y"]) = SOME(["x","y"]), | |
all_except_option("foo", ["x","foo","y"]) = SOME(["x","y"]), | |
all_except_option("foo", ["x","y","foo"]) = SOME(["x","y"])] | |
val test1b = [ |
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
(* | |
comments on euler 1 in SML | |
http://smlpraxis.com/blog/2013/02/14/multiples-of-3-and-5/ | |
*) | |
fun multiples_of n max = | |
let fun build_multiples current_mult list_so_far = | |
if current_mult >= max | |
then list_so_far | |
else let val next_mult = current_mult + n |
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
(define (my-stream-maker val-fn next-state seed) | |
(define (stream-thunk current-state) | |
(lambda () (cons (val-fn current-state) | |
(stream-thunk (next-state current-state))))) | |
(stream-thunk seed)) | |
(define ones | |
(my-stream-maker identity | |
identity |
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
(define S (fun "S" "x" (fun #f "y" | |
(fun #f "z" | |
(call (call (var "x") (var "z")) | |
(call (var "y") (var "z"))))))) | |
(define K (fun "K" "x" (fun #f "y" (var "x")))) | |
(define I (fun "I" "x" (var "x"))) | |
;; SKK | |
(define SKK | |
(call (call S K) K)) |
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
<html> | |
<head> | |
<title>TEST</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
</head> | |
<body> | |
Bitcoin price is <b id="price">--</b> | |
<script> | |
$(function(){ | |
$.get("https://data.mtgox.com/api/1/BTCUSD/ticker", function(data) { |
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 dollars-and-cents | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:require [clojure.core.logic.fd :as fd])) | |
;; A bank teller made a mistake today. The teller switched the dollars | |
;; and cents when they cashed a check for Mrs. Jones, giving her | |
;; dollars instead of cents and cents instead of dollars. | |
;; After buying a newspaper for 5 cents, Mrs. Jones realized that she |
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 sudoku | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:require [clojure.core.logic.fd :as fd])) | |
(defn init-board [vars puzzle] | |
(matche [vars puzzle] | |
([[] []] | |
succeed) |
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 logic.nono | |
(:refer-clojure :exclude [==]) | |
(:use [clojure.core.logic]) | |
(:require [clojure.core.logic.fd :as fd])) | |
(def max-size 25) | |
(defn count-ones [marks howmany post-marks] | |
(conde | |
[(emptyo marks) |