Skip to content

Instantly share code, notes, and snippets.

View caged's full-sized avatar
🎸

Justin Palmer caged

🎸
View GitHub Profile
# 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
#!/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
#!/usr/bin/env ruby
#
# DarkRoom
# Takes fullsize screenshots of a web page.
# Copyright (c) 2007 Justin Palmer.
#
# Released under an MIT LICENSE
#
# Usage
# ====
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
framework 'ScriptingBridge'
# SBElementArray bombs without this
class SBElementArray
def to_ary
NSArray.arrayWithArray(self)
end
end
xcode = SBApplication.applicationWithBundleIdentifier("com.apple.xcode")
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!="")
//
// 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;
// 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]]) {
#!/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
516cd4a07c512b5406c2f680ca6a880d67189b19 tag refs/tags/v2.2.0
44c3b865ac52a7c9a6312982ba0f6c20d7ad41e1 commit refs/tags/v2.2.1