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
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness
namespace :ts do
desc "Stop the sphinx server"
task :stop , :roles => :app do
run "cd #{current_path} && rake thinking_sphinx:stop RAILS_ENV=production"
end
desc "Start the sphinx server"
task :start, :roles => :app do
run "cd #{current_path} && rake thinking_sphinx:configure RAILS_ENV=production && rake thinking_sphinx:start RAILS_ENV=production"
end
require 'hirb'
# don't show [created|updated|deleted]_at fields from ActiveRecord tables
class Hirb::Helpers::MyActiveRecordTable < Hirb::Helpers::ActiveRecordTable
def self.render(rows,opts={})
rows = [rows] unless rows.is_a?(Array)
opts[:fields] = rows.first.class.columns.reject {|c| c.type == :datetime}.map {|c| c.name.to_sym}
super(rows, opts)
end
end
- (void)connection:(CPURLConnection)connection didReceiveResponse:(CPURLResponse *)response
{
var httpResponse = (CPHTTPURLResponse *)response;
console.log([httpResponse statusCode]);
}
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$('#my-div').children().not("a").click( function() {
$("#my-div-radio").attr('checked', 'checked');
});
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
@import <Foundation/CPObject.j>
@import "JSmenu.j"
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
#!/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}")
@import <AppKit/CPMenu.j>
@implementation JSMenu : CPMenu
{
CPMenuItem SessionMenuItem;
}
- (id)init
{
if (self = [super init])
@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'])