Skip to content

Instantly share code, notes, and snippets.

@Bost
Bost / HelloWorld.java
Created April 11, 2013 11:51 — forked from kano4/HelloWorld.java
java - HelloWorld
public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello, World!");
}
}
@Bost
Bost / loop-recur.clj
Last active November 23, 2015 11:49
clojure loop recur
(loop [r 0
break false]
(if-not break
(if (< r 5)
(do
(println "Expensive calculation of r:" r)
(recur (inc r) false))
(do
(println "Breaking the loop at:" r)
(recur r true)))))
@Bost
Bost / network.el
Created May 3, 2015 22:01
network-interface-list
(defun test-internet ()
(remove-if (lambda (el)
(string-match-p "lo.*" (car el)))
(network-interface-list)))
(test-internet)
(defun tzz-has-network ()
(remove-if (lambda (i)
(or (string-match-p "\\(vboxnet\\|docker\\).*" i)
@Bost
Bost / conduit.clj
Last active August 29, 2015 14:20 — forked from attentive/conduit.clj
clojure; enlive - dynamic deftemplate
(ns gist.conduit
(:require [net.cgrand.enlive-html :as html]
[net.cgrand.tagsoup :as tagsoup]))
; The implementations of conduit and defconduit are modified versions of
; the macros template and deftemplate from the guts of Enlive.
; They're named 'conduit' because the selectors and transformations serve as a
; channel between the scaffold of HTML and some data provided as an argument.
@Bost
Bost / d3.chart.analog.js
Last active August 29, 2015 14:01 — forked from marufbd/d3.chart.analog.js
d3js - Data-Driven Documents
(function () {
d3.analog= function() {
var height = 200, gap=10,
xValue = function(d) { return d[0]; },
xScale = null,
color = d3.scale.category10();
function chart(selection) {
selection.each(function(d) {
var g = d3.select(this);