Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
class Charge
def visit(obj, method, *args)
obj.public_send(:"#{method}_for_charge", args)
end
end
class Refund
def visit(obj, method, *args)
obj.public_send(:"#{method}_for_refund", args)
[nelhage@anarchique:~]$ sudo dpkg-divert --divert /usr/share/update-notifier/notify-reboot-required.orig --rename --add /usr/share/update-notifier/notify-reboot-required
Adding 'local diversion of /usr/share/update-notifier/notify-reboot-required to /usr/share/update-notifier/notify-reboot-required.orig'
[nelhage@anarchique:~]$ echo $'#!/bin/sh\nexit 0' | sudo tee /usr/share/update-notifier/notify-reboot-required
#!/bin/sh
exit 0
[nelhage@anarchique:~]$ sudo chmod +x /usr/share/update-notifier/notify-reboot-required
[nelhage@anarchique:~]$ sudo rm /var/run/reboot-required*
class To
def initialize(object)
@object = object
end
def method_missing(method, *args)
@object.public_send("to_#{method}", *args)
end
end
@nelhage
nelhage / read.go
Last active August 29, 2015 14:00
package reader
import "io"
func getRead(r io.Reader) func([]byte) (int, error) {
return r.Read
}
// partial output of `go tool 6g -S read.go`:
//
[nelhage@aeronautique:~]$ time ruby -rbson -e1
real 0m0.281s
user 0m0.233s
sys 0m0.042s
[nelhage@aeronautique:~]$ cd /tmp/
[nelhage@aeronautique:/tmp]$ cat > bson.go
package main
import _ "labix.org/v2/mgo/bson"
func main() {}
[A simple Brainfuck quine. This program is not a quine, but if you run
it, its output (which will be the same as the input, but stripped of
all comments and whitespace) will be.
We're going to represent things using four tape cells as one logical
struct. Skip right four cells to leave an empty start-of-tape marker.]
>>>>
>>>>
+++++>>>>+++++>>>>+++++>>>>+++++>>>>++>>>>+++++>>>>+++++>>>>+++++>>>>+++++>>>>+++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++++++>>>>++>>>>++++>>>>+++>>>>++>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++>>>>++++++>>>>++++++>>>>++++++>>>>++++++>>>>++>>>>++++++>>>>++++++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>++>>>>+++++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>++++++>>>>++++>>>>+++>>>>+++++>>>>+>>>>+++++>>>>++>>>>++++++>>>>+++++++>>>>++++++>>>>++++++>>>>+>>>>+++++>>>>+++++>>>>+++++>>>>++++>>>>+++>>>>++++++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++++>>>>+>>>>+>>>>+>>>>+>>>>++>>>>++++>>>>++++++>>>>++++>>>>++++>>>>++++>>
@nelhage
nelhage / node-logs
Last active August 29, 2015 14:02
logs
[2014-06-18 21:19:48.360749] 2014/06/18 21:19:48 [WARN] memberlist: Refuting a suspect message
[2014-06-18 21:20:06.393605] 2014/06/18 21:20:06 [WARN] memberlist: Refuting a dead message
[2014-06-18 21:20:51.393244] 2014/06/18 21:20:51 [WARN] memberlist: Refuting a dead message
[2014-06-18 21:21:30.393259] 2014/06/18 21:21:30 [WARN] memberlist: Refuting a suspect message
type MyThing struct {
sync.Mutex
}
type ThingBucket {
things []MyThing
}
dnl 8051.m4 -- m4 macro set for 8051 assembly programming
dnl 6.115 Final Project, Spring 2008 Nelson Elhage
dnl
dnl Contains a set of macros to simplify 8051 assembly programming
dnl slightly. Doesn't fundamentally change the process, but
dnl simplifies a few of the more repetitive tasks, particularly
dnl generating label names
changequote([,])dnl [] make better quoting characters
changecom([//])dnl