Skip to content

Instantly share code, notes, and snippets.

View spoon16's full-sized avatar
:shipit:

Eric Schoonover spoon16

:shipit:
  • Snohomish WA, Alexandria VA, and Costa Mesa CA
  • 11:19 (UTC -04:00)
View GitHub Profile
@spoon16
spoon16 / gist:2403227
Created April 17, 2012 03:34
lein clojurescript issue
$ lein repl
Deleting files generated by lein-cljsbuild.
Copying 1 file to /src/test/lib
Compiling ClojureScript.
Compiling "resources/public/js/test.js" from "src-cljs"...
Successfully compiled "resources/public/js/test.js" in 3.193873 seconds.
REPL started; server listening on localhost port 53484
user=> (require '[cljs.repl :as repl])
FileNotFoundException Could not locate cljs/repl__init.class or cljs/repl.clj on classpath: clojure.lang.RT.load (RT.java:430)
@spoon16
spoon16 / filter_nil_from_map.clj
Created February 18, 2012 08:51
filtering nil values from a map
(into {} (filter second {"DelaySeconds" DelaySeconds
"MessageRetentionPeriod" MessageRetentionPeriod
"MaximumMessageSize" MaximumMessageSize
"VisibilityTimeout" VisibilityTimeout
"Policy" Policy}))
@spoon16
spoon16 / util.clj
Created December 6, 2011 06:07
Protocol that normalizes different country representations
(defprotocol PCountryId
(country-id [c]))
(extend-protocol PCountryId
String (country-id [c] (country-id (NFCountry/findInstance c)))
clojure.lang.Keyword (country-id [c] (country-id (name c)))
NFCountry (country-id [c] (.getId c)))
@spoon16
spoon16 / error.txt
Created November 15, 2011 03:00
Maven/Lein Error
$ lein deps
[INFO] artifact org.clojure:clojure-contrib: checking for updates from releases
[INFO] artifact org.clojure:clojure-contrib: checking for updates from thirdparty
[INFO] artifact org.clojure:clojure-contrib: checking for updates from central
[INFO] artifact org.clojure:clojure-contrib: checking for updates from clojars
[INFO] artifact org.clojure:tools.logging: checking for updates from releases
[INFO] artifact org.clojure:tools.logging: checking for updates from thirdparty
[INFO] artifact org.clojure:tools.logging: checking for updates from central
[INFO] artifact org.clojure:tools.logging: checking for updates from clojars
[INFO] artifact log4j:log4j: checking for updates from releases
hello world
@spoon16
spoon16 / package.json
Created October 30, 2011 21:09
package.json example
{
"name": "example",
"version": "0.1.0",
"author": "User <email>",
"contributors": [
{ "name": "Eric Schoonover", "email": "erics@capdes.com" }
],
"repository": {
"type": "git",
"url": "https://github.com/user/repo"
@spoon16
spoon16 / ReverseHW C#
Created October 22, 2011 21:03 — forked from blaineh/ReverseHW C#
Reverse Hello world C#
//namespace names this object.
namespace blaine
{
class helloworld
{
//Every program starts with a Main method.
//Static indicates that you can access this method without having an object of your class available.
//void indicates to the compiler that your method will not return a value to the calling method.
static void Main()
{
@spoon16
spoon16 / out
Created October 7, 2011 22:47
winston log output when meta param is a literal ("literal" instead of {object: true})
7 Oct 22:45:15 - info: handshake authorized 0=6, 1=0, 2=8, 3=3, 4=8, 5=8, 6=3, 7=1, 8=7, 9=6, 10=8, 11=7, 12=1, 13=8, 14=7, 15=3, 16=6, 17=0, bold=608388317687187360, underline=608388317687187360, italic=608388317687187360, inverse=608388317687187360, grey=608388317687187360, black=608388317687187360, yellow=608388317687187360, red=608388317687187360, green=608388317687187360, blue=608388317687187360, white=608388317687187360, cyan=608388317687187360, magenta=608388317687187360, rainbow=608388317687187360, zalgo=6̥̳̣̣̠̲͍̞͖̬͉̟̫̩̦̺̘̥̱͚̯̖͍̘͎̲̼͍̪̦̰̼̭͇̩̠̮͇͖͈̬̯̟̜͕͖͍̪͖͚̲͍̬̤ͮͩ̆̏̍̕ͅ0̶̥̝̯̹̼̭̟͚̰̰̮̠̫͚̯̦̯ͣ̆̍͋ͩ͊ͣ8̵̮̟̦̰̺̲̝̰̪̻̩͉̩̬̭̙͙̬̪̠̹̮̤̤̙̥̲͙̜͎͔̟̼͍̮̠̪ͯ̏̔͐̓̐̐͂͌̓͋̋ͪ͂͂̆3̪͎̥̟͈̙̬̠͕͈̩̣̟̗̞͈̰̟̗̲̦̠̞̺̰̻̠̳̞̬̱͓͓̜͍̦̠̳͚̻̤̭̫͓͍̬̖̘͉̹͈̟ͭ̄́̾͐ͣ̔̍̌͊̓͗̌̕ͅͅͅ8̣̯̼̙̟̺͎͓̠̲̪̰̜͈͚̩͎̹̞̤̻͈̮͕̣̖̗̩̯̻̥̝̱̺̠̣ͣ̍́ͪ̾͌̓̃͐ͬ̍̂͠ͅ8̹̤̭̰̮̱̗̤̮̥̞̪̞͈͇̲̹̬͕̩̺͕̜̳͙̥͎͙ͬ͂͌̆ͦ͜ͅͅ3͖̜̥̙̗̫̝̮͕̩̙͇̩̫̩̫͇̼ͣ́̓ͨ̈ͫ̕ͅͅ1̧̜̥̥̰̰̣̲̘̠̖̝̭͙̯̮͉̩̥̬̼̰͙͉̮̗͎͔̪̲̘̘͙̗̹̹̠̱̺͚͖̜̥͙̞̩̀͊̎ͯͤ͒̒͗̉ͣ̈̈͂7̝̥̺̞͙̯̦̯̗̼̗̼̠̝͎͈̭̥̰̻̟̭̬͔ͬͧ̍͆̒̂͘ͅ6̻̪̮̦̘̳̰͚̣̬̰̘̮͈̙̤͇̻͎̮̘̬̻̯͚̱̗̟̬̘̼͖͔̘͕̗̟̳͈̪̤̰̭͙͎̪̤̰̖͋̈̌̀͐͊͛ͦ͟ͅͅ8̡̥̭̝͖̹ͩͮ̍ͩͪ7̤̰̟̺͉͚͔͚͓̟
import sys
class Graph(object):
def __init__(self, nodeCount, links):
self.nodeCount = nodeCount
self.matrix = [[False] * self.nodeCount for _ in range(self.nodeCount)]
for l in links:
self.matrix[l[0]][l[1]] = self.matrix[l[1]][l[0]] = True
def paths(self, path):
@spoon16
spoon16 / New-TableRow.ps1
Created May 3, 2010 04:51
Why is the output of this function (line:46 - $row) an instance of System.Array instead of an instance of Intellidimension.Rdf.TableRow?
function New-TableRow {
<#
.Synopsis
Creates a new table row that can be added to a table
.Description
Creates a new Intellidimension.Rdf.TableRow instance that can be added to a table
.Parameter cellCount
The number of cells the row will have