Skip to content

Instantly share code, notes, and snippets.

View fernyb's full-sized avatar

Fernando Barajas fernyb

View GitHub Profile
[fernando-barajass-macbook]
$sudo mysql_install_db5
Installing MySQL system tables...
090104 19:28:39 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090104 19:28:39 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090104 19:28:39 [Warning] Setting lower_case_table_names=2 because file system for /opt/local/var/db/mysql5/ is case insensitive
OK
Filling help tables...
090104 19:28:39 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090104 19:28:39 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
[75, 84] in /Library/Ruby/Gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb
75 def to_hash
76 lookup.dup
77 end
78
79 def materialize(deps, missing_specs = nil)
=> 80 materialized = self.for(deps, [], false, true).to_a
81 materialized.map! do |s|
82 next s unless s.is_a?(LazySpecification)
83 spec = s.__materialize__
@fernyb
fernyb / gist:726647
Created December 3, 2010 06:15
Borderless NSWindow
- (id)initWithContentRect:(NSRect)contentRect
styleMask:(NSUInteger)windowStyle
backing:(NSBackingStoreType)bufferingType
defer:(BOOL)deferCreation
{
[super initWithContentRect:contentRect
styleMask:NSBorderlessWindowMask
backing:bufferingType
defer:deferCreation];
@fernyb
fernyb / gist:726649
Created December 3, 2010 06:17
Stomp Client usage example
#define kUsername @"test"
#define kPassword @"user"
#define kQueueName @"/topic/deals"
#define kHost @"localhost"
#define kPort 61613
@fernyb
fernyb / gist:727026
Created December 3, 2010 14:37
NSStatusItem
NSStatusItem * statusItem;
statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain];
[statusItem setToolTip:@"ToolTip Name"];
[statusItem setTitle:@"Title"];
[statusItem setHighlightMode:YES];
[statusItem setMenu:statusMenu];
@fernyb
fernyb / gist:777982
Created January 13, 2011 15:00
nginx passenger
http {
...
passenger_root /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.2;
passenger_ruby /usr/local/bin/ruby;
...
}
@fernyb
fernyb / gist:785662
Created January 19, 2011 03:53
Starter Gemfile, haml, rspec, mongoid
source 'http://rubygems.org'
gem 'rails', '3.0.3'
gem 'haml', '3.0.25'
gem 'haml-rails', '0.3.4'
#gem 'sqlite3-ruby', :require => 'sqlite3'
# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
@fernyb
fernyb / gist:827033
Created February 15, 2011 03:08
Provide the callback url by the delegate and make sure autoStart is NO
NSDictionary *credentials = [NSDictionary dictionaryWithObjectsAndKeys:
consumerKey, kMPOAuthCredentialConsumerKey,
consumerSecret, kMPOAuthCredentialConsumerSecret,
nil];
_oauthAPI = [[MPOAuthAPI alloc] initWithCredentials:credentials
authenticationURL:[NSURL URLWithString:@"https://api.login.yahoo.com/oauth/v2/"]
andBaseURL:[NSURL URLWithString:@"https://api.login.yahoo.com/"]
autoStart:NO];
@fernyb
fernyb / AddNewPerson.m
Created February 24, 2011 17:03
Creating a new person with AddressBook.framework
ABPerson * newPerson = [[ABPerson alloc] init];
[newPerson setValue:@"John" forProperty:kABFirstNameProperty];
[newPerson setValue:@"Doe" forProperty:kABLastNameProperty];
ABMutableMultiValue * values = [[ABMutableMultiValue alloc] init];
[values addValue:@"example@example.com" withLabel:kABOtherLabel];
[newPerson setValue:values forProperty:kABEmailProperty];
@fernyb
fernyb / NSFileManager+FRBMethods.h
Created March 5, 2011 02:12
Obj-C wrapper method for, File Manager API, to overwrite a file.
@interface NSFileManager (FRBMethods)
- (BOOL)overwriteFileAtPath:(NSString *)src toPath:(NSString *)dst;
@end