Skip to content

Instantly share code, notes, and snippets.

Justin Palmer caged

Block or report user

Report or block caged

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
View gist:10794
# GNCommand event, url scope => current repo, NSURL that was dropped
GNCommand.on :drop, :scope => 'github.com' do |repo, url|
components = url.path.pathComponents
if components.include? 'tree'
end
if components.include? 'commit'
end
View gist:28617
#!/usr/bin/env ruby
#
# DarkRoom
# Takes fullsize screenshots of a web page.
# Copyright (c) 2007 Justin Palmer.
# Rewrote for MacRuby by Laurent Sansonetti.
#
# Released under an MIT LICENSE
#
# Usage
View Darkroom - WebKit Screenshots
#!/usr/bin/env ruby
#
# DarkRoom
# Takes fullsize screenshots of a web page.
# Copyright (c) 2007 Justin Palmer.
#
# Released under an MIT LICENSE
#
# Usage
# ====
View gist:48499
describe "Users Controller", "find_recent action" do
it "should find all users who've been active in the last 24 hours" do
@users = mock("A list of users")
User.should_receive(:find_all).with(24).and_return(@users)
c, r = request("/users/find_recent/24")
c.body.should eql(@users.to_json) # Where is the to_json method coming from? Will it actually contain any data?
end
end
View gist:57845
framework 'ScriptingBridge'
# SBElementArray bombs without this
class SBElementArray
def to_ary
NSArray.arrayWithArray(self)
end
end
xcode = SBApplication.applicationWithBundleIdentifier("com.apple.xcode")
View best validation ever
function validate(){
if(document.frm_registracion.txtApellido.value!="")
if(document.frm_registracion.txtNombre.value!="")
if(document.frm_registracion.txtDocumento.value!="")
if(document.frm_registracion.txtDomicilio.value!="")
if(document.frm_registracion.cmbPais.value!=0)
if(document.frm_registracion.cmbProvincia.value!=0)
if(document.frm_registracion.cmbLocalidad.value!=0)
if(document.frm_registracion.txtCodPostal.value!="")
if(document.frm_registracion.txtTelefono.value!="")
View NSString+Hendrix.h
//
// NSString+Hendrix.h
// Hendrix
//
// Created by Justin Palmer on 3/2/09.
// Copyright 2009 Alternateidea. All rights reserved.
//
@interface NSString (Hendrix)
- (NSString *)underscore;
- (NSString *)dasherize;
View gist:85761
// KMLoginResponse inherits from KMReponse
- (void)request:(KMRequest*)request didReceiveResponse:(KMResponse*)theResponse
{
[request release];
if ([delegate respondsToSelector:@selector(client:didReceiveResponse:)]) {
[delegate client:self didReceiveResponse:theResponse];
}
// I think this fails as theResponse comes in as a KMResponse
if ([[KMLoginResponse class] isKindOfClass:[theResponse class]]) {
View gist:86435
#!/usr/bin/env macruby
#
# DarkRoom
# Takes fullsize screenshots of a web page.
# Copyright (c) 2007 Justin Palmer.
# Rewrote for MacRuby by Laurent Sansonetti.
#
# Released under an MIT LICENSE
#
# Usage
View gist:97384
516cd4a07c512b5406c2f680ca6a880d67189b19 tag refs/tags/v2.2.0
44c3b865ac52a7c9a6312982ba0f6c20d7ad41e1 commit refs/tags/v2.2.1
You can’t perform that action at this time.