Skip to content

Instantly share code, notes, and snippets.

View masahitojp's full-sized avatar
🎯
Focusing

Masato Nakamura masahitojp

🎯
Focusing
View GitHub Profile
@yatsuta
yatsuta / gist:1047733
Created June 26, 2011 16:02
Lisp by R
opt <- options(warn=-1)
## ------------------------------------------------------------
## Test
## ------------------------------------------------------------
## > rm(list=ls()); source("Eval.R")
## > repl()
## rlisp > (<- make.counter (function (c) (function () (<<- c (+ c 1)))))
@gakuzzzz
gakuzzzz / gist:961416
Created May 8, 2011 15:01
anormの拡張
import play.db.anorm._
import play.db.anorm.defaults._
trait Identifiable[A] {
type ID = A
val id: Pk[ID]
}
trait ExMagic[A <: Identifiable[_]] extends Magic[A] {
@btompkins
btompkins / Fabric-UserSetup.py
Created February 7, 2011 18:15
Simple fabric function to create a new user
def new_user(admin_username, admin_password):
env.user = 'root'
# Create the admin group and add it to the sudoers file
admin_group = 'admin'
runcmd('addgroup {group}'.format(group=admin_group))
runcmd('echo "%{group} ALL=(ALL) ALL" >> /etc/sudoers'.format(
group=admin_group))
# Create the new admin user (default group=username); add to admin group
@paulsmith
paulsmith / echo.go
Created January 12, 2011 06:09
A simple echo server testing a few interesting Go language features, goroutines and channels.
// $ 6g echo.go && 6l -o echo echo.6
// $ ./echo
//
// ~ in another terminal ~
//
// $ nc localhost 3540
package main
import (
@mooz
mooz / self.js
Created September 10, 2010 07:12
self
var global = this;
global.__defineGetter__("self", function _() {
return _.caller || global;
});
function foo() {
alert(self);
}