Skip to content

Instantly share code, notes, and snippets.

@bellbind
bellbind / Makefile
Last active October 17, 2019 18:29
[iojs][emscripten] Call sudoku solver function implemented in C on iojs
all: libsudoku.js sudoku.js sudoku
clean:
rm -f libsudoku.js sudoku.js sudoku
rm -f libsudoku.js.map sudoku.js.map
rm -f libsudoku.js.mem sudoku.js.mem
# library for using functions in hand written JavaScript code
libsudoku.js: libsudoku.c
emcc -g4 -Wall -Wextra -std=c11 $^ -o $@ \
-s EXPORTED_FUNCTIONS="['_output', '_sudoku']" \
@drstevens
drstevens / gist:9201268
Created February 25, 2014 02:03
Map.withDefaultValue is a bad idea
Welcome to Scala version 2.10.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> val map0 = Map.empty[Int, Int] withDefaultValue 0
map0: scala.collection.immutable.Map[Int,Int] = Map()
scala> val map1 = map0 mapValues(identity)
map1: scala.collection.immutable.Map[Int,Int] = Map()
/* global module:false */
module.exports = function(grunt){
grunt.initConfig({
pkg: '<json:package.json>',
meta: {
banner: '/*! <%= pkg.name %> */'
},
server: {
base: '.',
port: 9999
@viktorklang
viktorklang / swingactors.scala
Created April 19, 2012 17:25
Swing Actors using Akka
// ©2012 Viktor Klang
package akka.klang
import akka.dispatch.{ DispatcherPrerequisites, ExecutorServiceFactory, ExecutorServiceConfigurator }
import com.typesafe.config.Config
import java.util.concurrent.{ ExecutorService, AbstractExecutorService, ThreadFactory, TimeUnit }
import java.util.Collections
import javax.swing.SwingUtilities