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
# -*- 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) |
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
[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* | |
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 To | |
def initialize(object) | |
@object = object | |
end | |
def method_missing(method, *args) | |
@object.public_send("to_#{method}", *args) | |
end | |
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
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`: | |
// |
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
[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() {} |
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
[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.] | |
>>>> |
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
>>>> | |
+++++>>>>+++++>>>>+++++>>>>+++++>>>>++>>>>+++++>>>>+++++>>>>+++++>>>>+++++>>>>+++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++++++>>>>++>>>>++++>>>>+++>>>>++>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++>>>>++++++>>>>++++++>>>>++++++>>>>++++++>>>>++>>>>++++++>>>>++++++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>++>>>>+++++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>++++++>>>>++++>>>>+++>>>>+++++>>>>+>>>>+++++>>>>++>>>>++++++>>>>+++++++>>>>++++++>>>>++++++>>>>+>>>>+++++>>>>+++++>>>>+++++>>>>++++>>>>+++>>>>++++++>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++++++>>>>+++++>>>>+>>>>+>>>>+>>>>+>>>>++>>>>++++>>>>++++++>>>>++++>>>>++++>>>>++++>> |
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
[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 |
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
type MyThing struct { | |
sync.Mutex | |
… | |
} | |
type ThingBucket { | |
things []MyThing | |
} |
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
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 |