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
[NSEvent addGlobalMonitorForEventsMatchingMask:NSKeyDownMask handler:^(NSEvent *event) { | |
NSLog(@"hi"); | |
}]; |
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
/* RESET */ | |
html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input { margin: 0; padding: 0; } | |
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th { font-size: 1em; font-weight: normal; font-style: normal; } | |
ul,ol { list-style: none; } | |
fieldset,img { border: none; } | |
caption,th { text-align: left; } | |
table { border-collapse: collapse; border-spacing: 0; } | |
/* LAYOUT */ | |
.clear { clear:both; } |
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
∴ rails server | |
Usage: | |
rails new APP_PATH [options] | |
Options: | |
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL) | |
-b, [--builder=BUILDER] # Path to an application builder (can be a filesystem path or URL) | |
-r, [--ruby=PATH] # Path to the Ruby binary of your choice | |
# Default: /Users/millsb/.rvm/rubies/ruby-1.8.7-head/bin/ruby | |
[--edge] # Setup the application with Gemfile pointing to Rails repository |
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
source :gemcutter | |
gem 'rails', '3.0.0.rc' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
#gem 'sqlite3-ruby', :require => 'sqlite3' | |
# Use unicorn as the web server |
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
server { | |
server_name myhost.com; | |
listen 80; | |
error_log /var/log/myhost.com-error.log; | |
access_log /var/log/myhost.com-access.log; | |
location ~ \.php$ { | |
include /etc/nginx/fastcgi_params; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME /WebServer/Documents/myhost$fastcgi_script_name; |
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
def self.find_by_username_or_email(login) | |
find_by_email(login) || find_by_login(login) | |
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
source 'http://rubygems.org' | |
gem 'capistrano' | |
gem 'mysql' | |
gem 'rails', '3.0.0.beta4' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
# To use debugger | |
# gem 'ruby-debug' |
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
git clone git://github.com/remear/xcodegitconfig.git | |
cd xcodegitconfig | |
sudo ruby InstallXcodeProjectGitSettings.rb |
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
- (BOOL)insertNewObject | |
{ | |
// Create a new instance of the entity managed by the fetched results controller. | |
NSManagedObjectContext *context = [fetchedResultsController managedObjectContext]; | |
NSEntityDescription *entity = [[fetchedResultsController fetchRequest] entity]; | |
NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; | |
// If appropriate, configure the new managed object. | |
NSLog(@"%@", currentID); | |
[newManagedObject setValue:[currentID stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] forKey:@"id"]; |