Skip to content

Instantly share code, notes, and snippets.

import akka.actor._
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.Implicits.global
class WaitFor(var messages: List[Any => Boolean], andThen: ActorRef) extends Actor with Stash {
var received = List[Any]()
val justForward: Receive = { case msg => andThen forward msg}

Keybase proof

I hereby claim:

  • I am gmarceau on github.
  • I am gmarceau (https://keybase.io/gmarceau) on keybase.
  • I have a public key whose fingerprint is 411D B806 EB46 CB92 A22E 58C0 DF67 3496 4D57 8332

To claim this, I am signing this object:

@gmarceau
gmarceau / structure of the code follows structure of the data
Created March 30, 2015 01:30
structure of the code follows structure of the data
// loadtweets.js: exports init function, which loads tweets from ./tweets folder into tweet_collection global variable.
var fs = require('fs');
var _und = require('./underscore-min')._;
tweet_collection = [];
function Tweet(diskTweet, donor) {
// if encapsulated RT, act on retweeted_status value instead of entire tweet
@gmarceau
gmarceau / parsing_test.js
Created March 30, 2015 01:32
elementatry testing in node
var should = require('should.js');
var p = require('./parsing.js')
var test Tweet =
{
"source" : "web",
"entities" : {
"user_mentions" : [ {
"name" : "Joanne Michele",
"screen_name" : "sabzbrach",
@gmarceau
gmarceau / expression_integrity_metric.rkt
Created May 15, 2015 18:09
Do Values Grow on Trees?: The Expression Integrity Metric
;;
;; The code implementing the expression integrity metric presented in
;;
;; Do Values Grow on Trees?: Expression Integrity in Functional Programming
;; Guillaume Marceau, Kathi Fisler, Shriram Krishnamurthi
;; SIGCSE International Computing Education Research Workshop, 2011
;;
;; http://gmarceau.qc.ca/papers/Marceau-2011-Do-Values-Grow-on-Trees.pdf
;;
;; Guillaume Marceau's .emacs
;;
(cd (getenv "HOME"))
(setq inhibit-startup-message t)
(set-background-color "black")
(set-foreground-color "white")
;; make all "yes or no" prompts show "y or n" instead
(fset 'yes-or-no-p 'y-or-n-p)
@gmarceau
gmarceau / beautiful_mathematica.png
Last active July 6, 2016 21:39
beautiful_mathematica
beautiful_mathematica.png
@gmarceau
gmarceau / to_airtable
Last active February 15, 2017 21:20
Send the output of a command to an Airtable table, along with timestamp and summary of the current git state
#!/usr/bin/env python
import sys
from airtable import airtable
import datetime
from plumbum.cmd import git
_, api_key, base_id, table_name = sys.argv[0:4]
all_stdin = sys.stdin.read()
brew cask install osxfuse
brew install homebrew/fuse/sshfs
mkdir -p ~/remote_mnt/my_server
sshfs -o allow_other,defer_permissions user@my_server:/ ./remote_mnt/my_server/