This file contains hidden or 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
What I mean is that even though JS method invocation seems to work like this: | |
(obj.method)(args) | |
it's a bit trickier than that. See this: | |
> a = {} | |
> a.toString() | |
"[object Object]" | |
> (a.toString)() |
This file contains hidden or 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 'open-uri' | |
require 'rexml/document' |
This file contains hidden or 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
"the government borrows from it... the government could borrow more money to pay it back" | |
No it doesn't. No it couldn't. Please please PLEASE read up on the structure of the Social Security system before parroting the right-wing line on this. (Did you notice your link here was to an advocate of privatization?) | |
Social Security payments are made from the current year's Social Security tax. Any surplus collected is, by law, used to purchase (essentially) Treasury securities. This is intragovernmental debt -- it's money the government owes itself. It's actually a huge part of our current federal debt. | |
The federal government then goes on to spend that money on services like any other revenue. It could potentially sequester that revenue in a fund, but what would it invest it in? What form of savings is more reliable than Treasury securities? You can't just pile up money in a vault somewhere. So the government doesn't "borrow" from the Social Security Trust Fund -- the government's debt IS the Social Security T |
This file contains hidden or 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
class Snatcher < BasicObject | |
C = ::Object.new | |
class << C | |
def abduct_method(meth, arity) | |
ObjectSpace.each_object(Module) do |mod| | |
next if mod.kind_of? Class | |
if mod.instance_methods.include?(meth) | |
return mod.instance_method(meth) | |
end |
This file contains hidden or 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 'ffi-rzmq' | |
inport, outport, label = ARGV[0], ARGV[1], ARGV[2] | |
context = ZMQ::Context.new(1) | |
simulation = Thread.new do | |
shoutsock = context.socket(ZMQ::PAIR) | |
shoutsock.bind("inproc://shouter") |
This file contains hidden or 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
#include <czmq.h> | |
#include <bstrlib.h> | |
const char* shouter_addr = "inproc://shouter"; | |
const char* listener_addr = "inproc://listener"; | |
const char* ui_addr = "inproc://ui"; | |
// Simulation Thread | |
typedef struct simulation_arg_t |
This file contains hidden or 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 | |
# Some of the words are misspelled to help the say program pronounce them right | |
# | |
# copy the following line and paste for fun! | |
# curl -O https://gist.githubusercontent.com/mrinterweb/0ed2ac30a97e25e03fad/raw/5da7c2a012a08cfcc9649e0f410d53f8986e4990/speak.rb && mv speak.rb speak && chmod a+x speak && ./speak | |
def envlist(name, &default) | |
results = (ENV["SPEAK_#{name.to_s.upcase}"] || "").split(":") | |
results.empty? ? default.call : results | |
end |
This file contains hidden or 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
alias λ proc | |
alias _l proc | |
class Object | |
def cnd(t:λ{},f:λ{}) | |
t[] | |
end | |
end | |
class NilClass |
This file contains hidden or 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
# bunny uses the default Ruby inspect, which means it includes nested objects. | |
# that means that inspecting a Bunny::Queue ends up dumping a screenful of irrelevant | |
# gunk nested somewhere deep in the protocol implementation. | |
# These monkeypatches make #inspect terse and relevant for Exchange, Queue, Channel, | |
# and Session. | |
# Caveat emptor: there are some configuration details the inspect format doesn't cover, | |
# and there are very likely bugs -- this was thrown together through some experimentation | |
# on the REPL. |
This file contains hidden or 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
run: | |
ocamlbuild -use-ocamlfind -package batteries world_common.native | |
ocamlbuild -use-ocamlfind -package batteries world.native && _build/world.native | tee results.txt | |
upload: | |
gist -u https://gist.github.com/mboeh/c45e477a8f737a9157e0 world.ml world_common.ml world_common.mli Makefile results.txt |