Skip to content

Instantly share code, notes, and snippets.

<table bgcolor='#000000' width='471' height='580' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td colspan='3'>
<a href='http://www.urbmob.com/' target='_blank'><img src='http://www.qmobile.us/widget/top.png' alt='Visit Urbmob.com to get your own ringtone widget!' border='0' width='471' height='145'></a>
</td>
</tr>
<tr>
<td rowspan='2' width='64' height='435'>
<img src='http://www.qmobile.us/widget/left.png' border='0' style='vertical-align:top;'>
</td>
require 'dl/import'
require "dl/struct"
module Hotkey
extend DL::Importable
# dlload "Carbon.framework/Frameworks/HIToolbox.framework/HIToolbox"
dlload "Carbon.framework/Carbon"
# OSStatus RegisterEventHotKey (
# UInt32 inHotKeyCode,
[STDERR, STDOUT, STDIN].each {|io| io.sync = true if !io.sync }
while true
ready = select([STDIN])
if ready.flatten.include? STDIN
foo = STDIN.gets
p foo
end
my_time_formats = {
:date_time12 => "%m/%d/%y %I:%M%p",
:date_time24 => "%m/%d/%y %H:%M",
:file => "%Y-%m-%d-%H-%M%p",
:search => "%m/%d/%Y",
:default => "%m/%d/%y %I:%M%p"
}
my_date_formats = {
:date_time12 => "%m/%d/%y",
:date_time24 => "%m/%d/%y",
// Module to contain logic for fixing characters.
var FigureFixer = {
Map: { }, // Holds character/code pairs
// Adds a character/code pairing, where the "code"
// is the escaped string and the "character" is the
// character that should replace it.
add: function(code, character) {
FigureFixer.Map[code] = character;
},
REST/CRUD conventions from http://project.ioni.st/post/2283#snippet_2283
// Define a category on NSObject for our delegate methods
@interface NSObject (ELLayerViewDelegate)
- (void)hexSelected:(ELLayerView *) column:(int)col row:(int)row;
@end
if( [delegate respondsToSelector:@selector(hexSelected:column:row:)] ) {
[delegate hexSelected:self column:selectedCol row:selectedRow];
}
/Users/matt/Projects/LucidMac/Elysium/src/ELLayerView.m:113: warning: no '-hexSelected:column:row:' method found
# I was hoping something like this might work ....
# The hope was that config.database could as easily be a string as a hash....
+++configurations/development.rb
module Blog
module Configurations
class Development < Default
module EnumThing
def categories
@categories ||= connection.execute("SELECT category FROM #{table_name} GROUP BY category").collect{|r|r[0]}
end
include InstanceMethods
module InstanceMethod
def categories
self.class.categories
end