My Recent Pastes (628 and counting)
All Pasties (over 628 and counting)
Below are summaries of the 15 most recent pasties by Allan Odgaard.
June 25, 2006
10:28PM EDT
by Allan Odgaard
View more (7 lines)
1 2 3 4 5 |
when /^</
classes = token.scan(/^<([^>]+)>$/)[0][0].split(/\./)
list = []
begin
list.push(classes.join('_'))
|
June 25, 2006
10:22PM EDT
by Allan Odgaard
View more (12 lines)
1 2 3 4 5 |
{ name = 'meta.group.named.regexp';
begin = '(\()(\?<)([a-z](\w*)>)';
end = '(\))';
beginCaptures = {
1 = { name = 'keyword.control.group.regexp';};
|
June 25, 2006
10:21PM EDT
by Allan Odgaard
View more (12 lines)
1 2 3 4 5 |
{ name = 'meta.group.named.regexp';
begin = '(\()(\?<)([a-z](\w*)>)';
end = '(\))';
beginCaptures = {
1 = { name = 'keyword.control.group.regexp';};
|
June 25, 2006
10:04PM EDT
by Allan Odgaard
View more (30 lines)
1 2 3 4 5 |
<?php
$factor = 327;
$base = 0x9762;
|
June 25, 2006
10:01PM EDT
by Allan Odgaard
View more (30 lines)
1 2 3 4 5 |
<?php
$factor = 3451;
$base = 0x43759762;
|
June 25, 2006
6:08PM EDT
by Allan Odgaard
View more (15 lines)
1 2 3 4 5 |
function simple_obfuscate ($i) {
global $factor, $base;
$res = ($i * $factor) ^ $base;
$right = $res & 0xFFFF;
$left = (($res ^ $left) >> 16) ^ $right;
|
June 25, 2006
5:40PM EDT
by Allan Odgaard
View more (16 lines)
1 2 3 4 5 |
def convert_number_to_words(number, word_list)
base = word_list.length
res = []
until number < base
remainder = number % base
|
June 25, 2006
12:43PM EDT
by Allan Odgaard
View more (7 lines)
1 2 3 4 5 |
#!/usr/local/bin/ruby -w require "enumerator" |
June 24, 2006
6:36PM EDT
by Allan Odgaard
View more (14 lines)
1 2 3 4 5 |
#!/usr/bin/env ruby require '/Applications/TextMate.app/Contents/SharedSupport/Support/lib/plist' ARGV.each do |file| |
June 23, 2006
10:09AM EDT
by Allan Odgaard
View more (74 lines)
1 2 3 4 5 |
require "open3" require 'cgi' def esc(str) CGI.escapeHTML(str).gsub(/\n/, '<br>') |
June 23, 2006
9:43AM EDT
by Allan Odgaard
1 2 3 4 |
def esc_sh
# self.gsub(/[{}()`'"\\; $<>&]/, '\\\\\&')
self.gsub(/[^a-zA-Z0-9_.]/, '\\\\\&')
end
|
June 22, 2006
7:34PM EDT
by Allan Odgaard
View more (40 lines)
1 2 3 4 5 |
On Tue, 17 May 2005 14:44:41 +0200, Luc Heinrich wrote: > CFIndex idx, cnt; > char **args = *_NSGetArgv(); > cnt = *_NSGetArgc(); |
June 22, 2006
6:51PM EDT
by Allan Odgaard
View more (33 lines)
1 2 3 4 5 |
/* Modifier keys: start with C-m */
"^m" = {
"^e" = ("insertText:", "\U21A9"); /* C-e return */
"e" = ("insertText:", "\U2305"); /* e enter */
|
June 22, 2006
3:30PM EDT
by Allan Odgaard
View more (9 lines)
1 2 3 4 5 |
if([self shouldChangeTextInRange:selectedRange replacementString:newString])
{
if(!hadSelection)
[self setSelectedRange:NSMakeRange(0, [[self textStorage] length])];
[self insertText:newString];
|
Pastie