This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MBPro:loc_dashboard davidamcclain$ rake ts:in | |
(in /Users/davidamcclain/apps/notch8/loc_dashboard) | |
Generating Configuration to /Users/davidamcclain/apps/notch8/loc_dashboard/config/development.sphinx.conf | |
Sphinx 0.9.8-release (r1371) | |
Copyright (c) 2001-2008, Andrew Aksyonoff | |
using config file '/Users/davidamcclain/apps/notch8/loc_dashboard/config/development.sphinx.conf'... | |
indexing index 'post_core'... | |
ERROR: source 'post_core_0': unknown type 'pgsql'; skipping. | |
ERROR: index 'post_core': no valid sources configured; skipping. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// From http://www.gayadesign.com/diy/snotify-easy-notifications-in-jquery/ | |
var sNotify = { | |
timeOpen: 10, //change this number to the amount of second you want the message opened | |
queue: new Array(), | |
closeQueue: new Array(), | |
addToQueue: function(msg) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example of using a custom image as a view ? | |
customView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; | |
customView.image = [UIImage imageNamed:@"Foo.png"]; | |
[window addSubview: customView]; | |
[window bringSubviewToFront: customView]; | |
// Process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200 | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
return YES; | |
} | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *tz = [[NSTimeZone localTimeZone] name]; | |
// Or ... | |
NSString *tz = [[NSTimeZone localTimeZone] localizedName:NSTimeZoneNameStyleShortDaylightSaving locale:[NSLocale currentLocale]]; // Returns @"PST" etc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lives in config/initializers/ | |
def recursive_symbolize_keys!(hash) | |
hash.symbolize_keys! | |
hash.values.select{|v| v.is_a? Hash}.each{|h| recursive_symbolize_keys!(h)} | |
end | |
AppSettings = YAML.load_file("#{Rails.root}/config/settings.yml")[Rails.env] | |
recursive_symbolize_keys!(AppSettings) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
def to_xml(options={}) | |
options[:only] = [:id, :name, :other_attr] | |
super(options) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)ordinalize:(NSInteger)number{ | |
if (number >= 11 && number <= 13) | |
return [NSString stringWithFormat:@"%dth",number]; | |
switch (number % 10) { | |
case 1: | |
return [NSString stringWithFormat:@"%dst",number]; | |
case 2: | |
return [NSString stringWithFormat:@"%dnd",number]; | |
case 3: | |
return [NSString stringWithFormat:@"%drd",number]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ps -ef | grep " process or pid " | grep -v grep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/usr/bin/indexer --config /data/loc/current/config/production.sphinx.conf --rotate --all |