This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example using the raf module from npm. try changing some values! | |
var requestAnimationFrame = require("raf") | |
var canvas = document.createElement("canvas") | |
canvas.width = 500 | |
canvas.height = 500 | |
document.body.appendChild(canvas) | |
var context = canvas.getContext("2d") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Example of using the first key in a map as the dispatch value for defmulti | |
(defmulti foo (fn [x] (first (map key x))) ) | |
(defmethod foo :a [x] ["a -> " x]) | |
(defmethod foo :b [x] ["b -> " x]) | |
(defmethod foo :default [x] ["default -> " x]) | |
(println (foo {:a "a"})) | |
(println (foo {:b "b"})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.ahum | |
import scala.annotation.tailrec | |
object TopologicalSorter { | |
def sort[T](nodes: (T, Seq[T])*): Seq[(T, Seq[T])] = { | |
type DepNode = (T, Seq[T]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import play.api._ | |
new StaticApplication(new java.io.File(".")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -maxdepth 1 -ctime +30 -type d | xargs rm -f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-01-20 16:21:30,193 - [ERROR] - from akka.actor.ActorSystemImpl in play-akka.actor.default-dispatcher-2 | |
Uncaught error from thread [play-akka.actor.default-dispatcher-5] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled | |
java.lang.ExceptionInInitializerError: null | |
at views.html.layouts.main$.apply(main.template.scala:104) ~[prizeo.prizeo-2.0-SNAPSHOT.jar:2.0-SNAPSHOT] | |
at views.html.Application.index$.apply(index.template.scala:48) ~[prizeo.prizeo-2.0-SNAPSHOT.jar:2.0-SNAPSHOT] | |
at views.html.Application.index$.render(index.template.scala:198) ~[prizeo.prizeo-2.0-SNAPSHOT.jar:2.0-SNAPSHOT] | |
at views.html.Application.index.render(index.template.scala) ~[prizeo.prizeo-2.0-SNAPSHOT.jar:2.0-SNAPSHOT] | |
at controllers.Application.renderIndex(Application.java:130) ~[prizeo.prizeo-2.0-SNAPSHOT.jar:2.0-SNAPSHOT] | |
at controllers.Application.indexCached(Application.java:113) ~[prizeo.prizeo-2.0-SNAPSHOT.jar:2.0-SNAPSHOT] | |
at controllers.Application.index(Application.java:94) ~[prizeo.prizeo-2.0-SNAPSHOT.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('initial-data', []).factory('Stuff', [function(){ | |
return { | |
stuff: {} | |
} | |
}]); | |
angular.module('my-app.controllers', ['initial-data']).controller('MyController', ['$log', 'Stuff', function($log, Stuff){ | |
$log.info(Stuff.stuff); | |
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.corespring | |
import org.specs2.mutable.Specification | |
import scala.collection._ | |
class JavaConversionsSpec extends Specification { | |
import scala.collection.JavaConversions._ | |
def contributors : java.util.Map[String, java.util.Collection[String]] = new java.util.HashMap[String,java.util.Collection[String]]() |