Skip to content

Instantly share code, notes, and snippets.

class Object
def scoped(&block)
self.instance_eval(&block)
end
end
module Kernel
def with_scoped(&block)
return lambda { |obj|
obj.instance_eval(&block)
@capnslipp
capnslipp / gist:1186489
Created September 1, 2011 15:55
RegExp'ing in JSON
var endOfScopeMarker = '\t\t},';
var find = new RegExp('"someProperty" : 3((?:(?!'+endOfScopeMarker+').|\n)+)("anotherPropertyWithinTheSameScope" : 1,)', "g");
var replace: '"someProperty" : 0$1$2';
@capnslipp
capnslipp / .gitconfig
Last active February 27, 2025 08:12
my global .gitconfig file(s), with tweaks for: command verbosity, more-distinct colors, and handy aliases
# Base
[core]
excludesfile = /Users/capnslipp/.git_excludes
attributesfile = /Users/capnslipp/.git_attributes
#editor = mate -w
editor = macdown-wait
whitespace = tabwidth=4, space-before-tab, indent-with-non-tab, blank-at-eol, blank-at-eof
# defaults: whitespace = blank-at-eol, space-before-tab, -indent-with-non-tab, -tab-in-indent, blank-at-eof, trailing-space, -cr-at-eol, tabwidth=8
quotepath = false
@capnslipp
capnslipp / index.html
Last active September 24, 2015 14:58
First Revision of 6bitt.com (2002-11-30)
<HTML>
<HEAD>
<TITLE>YOUR DUMB!!! STOMP STOMP!!</TITLE>
</HEAD>
<BODY bgcolor="#000000">
<TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
   <TR>
       <TD colspan="2" height="100%" align="center" valign="center">
           <CENTER>
@capnslipp
capnslipp / gist:716149
Created November 26, 2010 01:14
HTML Special Characters - Quick-Access Sheet
<dl>
<dt>emsp:</dt><dd><textarea>&emsp;</textarea></dd>
</dl>