Skip to content

Instantly share code, notes, and snippets.

runpaint

Block or report user

Report or block runpaint

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@runpaint
runpaint / gist:181199
Created Sep 4, 2009
Blah <code>class</code>
View gist:181199
class H
def [](k) k end
def []=(k, v) [k, v] end
end
a = H.new
a[123] = 2
p (a[123] += 2)
View gist:181070
%w{a b}.each do |name|
File.open(name,'w') do |f|
10000.times {|n| f.puts n }
end
end
a = File.open('a')
b = File.open('b')
a.reopen(b)
a.gets
a.reopen(b)
View gist:181065
a = File.open('a')
b = File.open('b')
a.reopen(b)
a.gets
a.reopen(b)
p a.gets
View gist:170542
/* 'Alnum': [[:Alnum:]] */
static const OnigCodePoint CR_Alnum[] = {
471,
0x0030, 0x0039,
0x0041, 0x005a,
0x0061, 0x007a,
0x00aa, 0x00aa,
0x00b5, 0x00b5,
0x00ba, 0x00ba,
View gist:169862
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
25,
000000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
0x0600, 0x0603,
0x06dd, 0x06dd,
0x070f, 0x070f,
0x17b4, 0x17b5,
View gist:169853
/* 'C': Major Category */
static const OnigCodePoint CR_C[] = {
25,
000000, 0x001f,
0x007f, 0x009f,
0x00ad, 0x00ad,
0x0600, 0x0603,
0x06dd, 0x06dd,
0x070f, 0x070f,
View gist:163342
class Object
def backtrace
Backtrace.new
end
end
class Backtrace
class Line
attr_reader :file, :line, :name
def initialize(line)
View gist:162534
From 47db9f7a55d8f938648c5751c0092cd3c2ae9558 Mon Sep 17 00:00:00 2001
From: Run Paint Run Run <runrun@runpaint.org>
Date: Wed, 5 Aug 2009 06:45:31 +0100
Subject: [PATCH] unicode.c: Add U+2064 (INVISIBLE PLUS) to Cf category
---
enc/unicode.c | 30 ++++++++++++++++--------------
1 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/enc/unicode.c b/enc/unicode.c
View gist:160735
h = {'foo' => 'bar'}
h.compare_by_identity
p h.compare_by_identity? #=> true
h['foo'] = 'glark'
p h #=> {"foo"=>"bar", "foo"=>"glark"}
j = h.dup
p j #=> {"foo"=>"glark"}
View gist:144723
doc(String, :slice, :[]) do
<<EOF
(Fixnum offset) => String or nil
Returns a substring of one character from _offset_. If _offset_ is
negative it's counted from the end of _self_. Returns _nil_ if _offset_
falls outside of _self_.
You can’t perform that action at this time.