Skip to content

Instantly share code, notes, and snippets.

View zerosum.clj
(defn can-sum-to-zero
([nums]
(can-zero nums #{}))
([nums can-sum-to]
(when (seq nums)
(let [num (first nums)]
(if (can-sum-to (- num))
true
(let [can-also-sum-to (map #(+ num %) can-sum-to)]
(recur (rest nums)
@orb
orb / sudoku.clj
Last active Jan 16, 2019 — forked from swannodette/gist:3217582
updated for the latest core.logic, with some minor tweaks for (I hope) clarity
View sudoku.clj
(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)
View mtgox.html
<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) {
You can’t perform that action at this time.