Skip to content

Instantly share code, notes, and snippets.

View stevehorn's full-sized avatar

Steve Horn stevehorn

  • Columbus, OH, USA
View GitHub Profile
### Keybase proof
I hereby claim:
* I am stevehorn on github.
* I am stevehorn (https://keybase.io/stevehorn) on keybase.
* I have a public key ASCtva-AnhGiTmxDGDd6x1laV0k7fmmdS6ZmKN5fZRtYaQo
To claim this, I am signing this object:
@stevehorn
stevehorn / child.js
Last active March 24, 2018 13:28
Node fork example
console.log(`CHILD process id: ${process.pid}`);
setTimeout(() => {
console.log('child timeout');
}, 5000);
@stevehorn
stevehorn / gist:2001697
Created March 8, 2012 16:01
Spy Confusion
//Want to use this test setup
describe("Topography Controls", function () {
beforeEach(function () {
loadFixtures("NFocusMap.html");
this.dummyMap = new GoogleMapWrapper(null);
spyOn(this.dummyMap, 'addControlsRightTop');
spyOn(this.dummyMap, 'setOverlay');
this.classUnderTest = new ClassUnderTest(this.dummyMap);
#Repository hgrc file
[paths]
default = http://somehwere.over.the.rainbow.com/hg/repository
another = http://bitbucket.org/repository
@stevehorn
stevehorn / gist:851722
Created March 2, 2011 20:53
VB.Net Dictionary Initializer
'This language is tortured, I tell you
Dim variable As New Dictionary(Of String, Boolean) From {{"Dumb", True}, {"Idiotic", True}}
@stevehorn
stevehorn / gist:826502
Created February 14, 2011 20:40
Autohotkey For empty anonymous function
;Executed by typing fx<space>
:*:fx ::
;Send left curly
SendEvent function() {{}
Send {Enter}
;Send right curly
SendEvent {}}
Send {Up}
Send {End}
@stevehorn
stevehorn / gist:784641
Created January 18, 2011 16:05
instance_eval vs. class_eval
String.instance_eval {
def pie
"mmmm"
end
}
puts String.pie
String.class_eval {
def cake
steve@steve-ubuntu:~/Documents/Code/sample_blog$ sudo gem install padrino
ERROR: Error installing padrino:
bundler requires RubyGems version >= 1.3.6
steve@steve-ubuntu:~/Documents/Code/sample_blog$ gem update --system
Updating RubyGems
Nothing to update
steve@steve-ubuntu:~/Documents/Code/sample_blog$ gem -v
1.3.7
with something as (
select * from some_table
)
select * from something
select * from something --fail
@stevehorn
stevehorn / gist:639760
Created October 22, 2010 01:40
How do I stub and/or redefine a javascript object dependency?
//Code under test
function Foo() {
this.do_something_interesting = function() {
var dependency = new CanYouMockMe();
if(dependency.i_want_stubbed() === true) {
//do stuff based on condition
} else {
//do stuff if false
}
}