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
@import <Foundation/CPObject.j>
@import "JSmenu.j"
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
<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');
});
- (void)connection:(CPURLConnection)connection didReceiveResponse:(CPURLResponse *)response
{
var httpResponse = (CPHTTPURLResponse *)response;
console.log([httpResponse statusCode]);
}
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
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
=== 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
require 'date'
class Santo
def is_awesome?
true
end
def birthday_today?
today = Date.today
today.month == bday.month && today.day == bday.day
require 'test_helper'
class DownloadsTest < ActionController::IntegrationTest
context "An existing donor" do
setup do
@donor = Factory(:donor)
end
should " be able to download a tax receipt" do
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeSound | UIRemoteNotificationTypeAlert)];
}
// Delegation methods
- (void)application:(UIApplication *)app didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)devToken {
Device *device = [[Device alloc] init];
device.token = [devToken description];