Skip to content

Instantly share code, notes, and snippets.

Avatar

Craig Ludington craig-ludington

View GitHub Profile
View words.clj
(defn score
[word]
(let [wc (count word)
uc (count (into #{} (map identity (clojure.string/lower-case word))))]
{:word word :score (if (= wc uc) wc 0)}))
(defn winner
[words]
(let [m (group-by :score (map score words))]
(m (apply max (keys m)))))
View keybase.md

Keybase proof

I hereby claim:

  • I am craig-ludington on github.
  • I am alpheus (https://keybase.io/alpheus) on keybase.
  • I have a public key whose fingerprint is EDF4 74B1 C642 BBFE E72A 0B88 00F3 4B7E 3079 CBFF

To claim this, I am signing this object:

@craig-ludington
craig-ludington / You cannot copy text!.js
Created Oct 14, 2015
These data are no longer on our web site.
View You cannot copy text!.js
<script>
$(document).ready(function() {
$(function() {
$('body').bind('cut copy', function(e) {
e.preventDefault();
alert('You cannot ' + e.type + ' text!');
});
});
$(function() {
$(this).bind("contextmenu", function(e) {
@craig-ludington
craig-ludington / gist:2d8bf9804cbbc93731a9
Created Mar 31, 2015
Exception that happens on only one machine.
View gist:2d8bf9804cbbc93731a9
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar from clojars
#<CompilerException java.lang.IllegalArgumentException: No single method: _setup of interface: cljs.repl.IJavaScriptEnv found for function: -setup of protocol: IJavaScriptEnv, compiling:(cemerick/piggieback.clj:149:5)>
Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cemerick.piggieback/wrap-cljs-repl in this context, compiling:(/private/var/folders/j7/0jk8693s26j_jn80w_7w6sw000010j/T/form-init8804850253847573659.clj:1:2644)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6651)
at clojure.lang.Compiler.analyze(Compiler.java:6445)
at clojure.lang.Compiler.analyze(Compiler.java:6406)
at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3719)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6646)
at clojure.lang.Compiler.analyze(Compiler.java:6445)
at clojure.lang.Compiler.analyze(Compiler.java:6406)