Skip to content

Instantly share code, notes, and snippets.

View foo
0xd3f66506b9227344Dc30a56E228f342b646eB61F
View gist:21ae3a66d47d0cffe4539c9b8d34897a
(defun split-window-multiple-ways (x y)
"Split the current frame into a grid of X columns and Y rows."
(interactive "nColumns: \nnRows: ")
;; one window
(delete-other-windows)
(dotimes (i (1- x))
(split-window-horizontally)
(dotimes (j (1- y))
(split-window-vertically))
(other-window y))
View gist:e54cb79465a16d2fc55b5e975a53888e
Two economists are walking down the street and one of them notices what appears to be a $20 bill (or a $100 bill—the monetary amounts vary) on the sidewalk. “It’s not a real $20 bill,” the other economist declares. “If it were a real $20 bill, someone would have picked it up off the sidewalk already.”
@drcode
drcode / foo
Created Jun 1, 2015
enode interface
View foo
'enode://400b11f152fd4a2348c059ada1f67ea8f732cf8e2fde8136a0ec174c443d63a7ccb27a50598bd65979565b1d4913f193af8f7ee2d69aae1a9aeba3fe58dbb26a@[::]:30303'
@drcode
drcode / contract.html
Created Feb 4, 2015
Contract.html for use with go-ethereum CLI JSON-RPC interface
View contract.html
<html>
<head>
<script type="text/javascript" src="bignumber.min.js"></script>
<script type="text/javascript" src="ethereum.js"></script>
<script type="text/javascript">
var web3 = require('web3');
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080'));
@drcode
drcode / balance.html
Created Feb 4, 2015
Version of balance.html for use with latest go-ethereum
View balance.html
<html>
<head>
<script type="text/javascript" src="bignumber.min.js"></script>
<script type="text/javascript" src="ethereum.js"></script>
<script type="text/javascript">
var web3 = require('web3');
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080'));
var coinbase = web3.eth.coinbase;
View gist:5040636
(ns groupon.core
(require [clojure.string :refer [lower-case]]))
;;functional code
(defn delete-item [items n]
(vec (concat (take n items) (drop (inc n) items))))
(def commands [{:name "(A)dd"
:key :a
View gist:5040624
(ns groupon.core
(require [clojure.string :refer [lower-case]]))
;;functional
(defn add-item [items item]
(conj items item))
(defn edit-item [items index item]
(assoc items index item))
View gist:4078420
(ns webfui-examples.add-two-numbers-low-level.core
(:use [webfui.dom :only [defdom add-dom-watch]]
[webfui.state-patches :only [patch]]))
(def my-dom (atom nil))
(defdom my-dom)
(def a 0)
(def b 0)