Skip to content

Instantly share code, notes, and snippets.

View hlprmnky's full-sized avatar

Chris Johnson hlprmnky

View GitHub Profile
import subprocess as sp
proc = sp.Popen(['/usr/local/bin/node', '-p'], stdin=sp.PIPE, stdout=sp.PIPE)
(stdout, stderr) = proc.communicate('4 * 1\n')
print(stdout)
// Produce all primes from 2 to target using
// the Sieve of Eratosthenes - https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes
func eratosthenes(target: Int) -> [Int] {
if target < 2 {
return []
}
var marked = Set<Int>()
return (2...target).filter {
(let number) -> Bool in
var product = number * 2
@hlprmnky
hlprmnky / REPL output
Created February 9, 2015 19:03
Node.js CLJS-REPL woes
~/cljs-aws [ lein repl
Picked up JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
Picked up JAVA_TOOL_OPTIONS: -Djava.awt.headless=true
nREPL server started on port 43339 on host 127.0.0.1 - nrepl://127.0.0.1:43339
REPL-y 0.3.5, nREPL 0.2.6
Clojure 1.6.0
OpenJDK 64-Bit Server VM 1.7.0_75-b13
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)