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
(def gorilla-version "0.4.0") ;; adapt this as needed | |
(set-env! | |
:resource-paths #{"src" "resources"} | |
:dependencies '[[gorilla-repl "0.4.0"]]) ;; version! | |
(task-options! | |
pom {:project 'restaurant | |
:version "0.1.0-SNAPSHOT"} | |
jar {:manifest {"Foo" "bar"}}) |
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
➜ ~ brew install freealut | |
==> Downloading http://connect.creativelabs.com/openal/Downloads/ALUT/freealut-1.1.0.tar.gz | |
curl: (6) Could not resolve host: connect.creativelabs.com | |
Trying a mirror... | |
==> Downloading http://ftp.de.debian.org/debian/pool/main/f/freealut/freealut_1.1.0.orig.tar.gz | |
######################################################################## 100.0% | |
==> Patching | |
patching file configure.ac | |
==> ./autogen.sh |
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
#!/bin/zsh | |
# usage: wake_me <command> | |
echo $@ | |
$@ | |
notification='display notification "'$@'" with title "Finished"' | |
osascript -e "$notification" | |
say -v Deranged "it's finally, finally finished. at last." |
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
# fixed version of http://altons.github.io/python/2012/12/01/converting-northing-and-easting-to-latitude-and-longitude/ | |
# - filenames | |
# - data type (pyproj transform doesn't like pandas series) | |
import os | |
import pandas as pd | |
import pyproj | |
import re | |
listfiles = os.listdir("codepo/Data/CSV") | |
pieces = [] |
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
% sleeping barber problem | |
-module(sleeping_barber). | |
-export([barber_scenario/0]). | |
start_shop() -> | |
spawn(fun() -> barber_shop() end) | |
. | |
barber_scenario() -> | |
ShopPid = start_shop(), |
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
module Barber | |
def loop(shop_pid) | |
shop_pid <- 'barbercheck | |
receive | |
match 'wakeup | |
IO.puts "wakeup" | |
loop(shop_pid) | |
match {'customer, customer} | |
cut_hair(shop_pid, customer) | |
loop(shop_pid) |
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
require 'zmq' | |
require 'json' | |
handler_ctx = ZMQ::Context.new(1) | |
# receive and response for mongrel2 handlers | |
# queue address corresponds to what's in the configuration | |
recv_queue = handler_ctx.socket(ZMQ::PULL) | |
recv_queue.connect("tcp://127.0.0.1:9999") |
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 main | |
import ( | |
"fmt" | |
"os" | |
) | |
type request struct { | |
data []int | |
replyChannel chan []int | |
} |
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
-module(sieve). | |
-export([run/1]). | |
run(M) -> | |
Numbers = lists:seq(3, M), | |
Startpid = self(), | |
spawn_link(fun() -> prime_filter(Startpid, 2, Numbers) end), | |
gather(). | |
gather() -> |
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
require 'nokogiri' | |
module Nokogiri | |
module XML | |
class Node | |
BLANK = /^[ \n]*$/ | |
# Comparing with other node | |
# - same name | |
# - same attributes |
NewerOlder