Skip to content

Instantly share code, notes, and snippets.

View jerodsanto's full-sized avatar
:shipit:
Always be shipping

Jerod Santo jerodsanto

:shipit:
Always be shipping
View GitHub Profile
upArrow = [[CPImage alloc] initWithContentsOfFile:@"Resources/upArrow.png" size:CGSizeMake(8.0, 7.0)];
downArrow = [[CPImage alloc] initWithContentsOfFile:@"Resources/downArrow.png" size:CGSizeMake(8.0, 7.0)];
@implementation CPTableHeaderView (myAdditions)
- (void)mouseDown:(CPEvent)anEvent
{
var selectedColumnNumber = [self columnAtPoint:[self convertPoint:[anEvent locationInWindow] fromView:nil]];
if(selectedColumnNumber == CPNotFound) return;
var post = [Post find:@"42"];
[post setTitle:@"Why X is Better than Y"];
[post save];
/*
* AppController.j
* tabKeyTest2
*
* Created by Jerod Santo on January 12, 2010.
* Copyright 2010, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
#!/usr/bin/env ruby
require 'net/http'
host = "8.7.192.55"
port = 4250
body = File.read("test.xml")
header = {'Content-Type' => 'xml'}
response = Net::HTTP.start(host, port) do |http|
http.post("AssignOrder.xml", body, header)
@jerodsanto
jerodsanto / gist:265428
Created December 29, 2009 17:02
CPPopUpButton as select box
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
CPString name;
CPDate date;
int integer;
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
2009-11-13 22:25:12.422 Cappuccino [warn]: undefined
@jerodsanto
jerodsanto / firebug_logger.rb
Created December 9, 2009 16:23 — forked from simonjefford/firebug_logger.rb
Rack::FirebugLogger
module Rack
class FirebugLogger
def initialize(app, options = {})
@app = app
@options = options
end
def call(env)
status, headers, orig_response = @app.call(env)
return [status, headers, orig_response] unless (headers["Content-Type"] =~ /html/ && env['firebug.logs'])
@import <AppKit/CPMenu.j>
@implementation JSMenu : CPMenu
{
CPMenuItem SessionMenuItem;
}
- (id)init
{
if (self = [super init])
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
abort %|Usage: #{File.basename(__FILE__)} "your message"| unless ARGV.length == 1
user = "your_username"
pass = "your_password"
Twitter::Base.new(Twitter::HTTPAuth.new(user,pass)).update("NOTICE: #{ARGV.first}")