Skip to content

Instantly share code, notes, and snippets.

>> m.read_attribute(:cache)
=> {:monkey=>321}
>> m.save
=> true
>> m.read_attribute(:cache)
=> {:monkey=>321}
>> m = Manager.find(m.id)
=> #<Manager....>
>> m.read_attribute(:cache)
=> {:monkey=>123}
@nkpart
nkpart / gist:2344
Created July 25, 2008 00:05
undefined
package com.vlc.beach.zoning;
import static com.googlecode.instinct.expect.Expect.expect;
import com.googlecode.instinct.integrate.junit4.InstinctRunner;
import com.googlecode.instinct.marker.annotate.Mock;
import com.googlecode.instinct.marker.annotate.Specification;
import static com.vlc.beach.zoning.SpecNotWorkingContext.Applicator.applicator;
import fj.F;
import org.jmock.Expectations;
import org.junit.runner.RunWith;
[16:06:26] <@Kittens> ec, εσείς μιλάτε ελληνικά;
[16:06:49] <@Kittens> i asked if you spoke greek
[16:07:02] <@ec> greek lines end in semicolons?
[16:07:05] <@ec> that explains... a lot.
[16:07:42] <@ec> I'll feel so much more justified in saying that Java is like Greek to me now!
Definitions.
ST = [^"]
L = [A-Za-z]
WS = ([\000-\s]|%.*)
D = [0-9]
H = [0-9a-fA-F]
Rules.
@drnic
drnic / filename.rb
Created July 25, 2008 01:27
Filename class for Ruby
##
# Simple class that makes File.* class methods available on a
# Filename object
#
# doctest: Can call File’s class methods on a Filename object
# >> Filename.new ("/tmp/myfile.png").dirname
# => "/tmp"
#
# doctest: Can create a Filename from another Filename object
# >> path = "/tmp/myfile.png"
<VirtualHost *:80>
ServerName blog.cylenceweb.com
ServerAlias blog.cylenceweb.com
DocumentRoot /var/www/web/blog
<Directory /var/www/web/blog>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
/* ボタンを押すと隠れた要素が出現するJavaScript */
<script language="JavaScript">
<!--
function menu(id) {
var disp = document.all(id).style.display;
if(disp != "none" || disp == "") {
document.all(id).style.display = "none";
}

this is SO weird

import time, threading, processing
for cls in [threading.Thread, processing.Process]:
start = time.time()
for _ in range(1000):
child = cls(target=lambda: None)
child.start()
child.join()
print 'Spawning 100 children with %s took %.2fs' % (
cls.__name__, time.time() - start)