This file contains 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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
passenger_root /home/USER/.rvm/gems/ruby-1.9.2-p290/gems/passenger-3.0.11; | |
passenger_ruby /home/USER/.rvm/wrappers/ruby-1.9.2-p290/ruby; |
This file contains 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/env bash | |
apt-get -y update | |
apt-get -y upgrade | |
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev | |
cd /tmp | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -xvzf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125/ | |
./configure --prefix=/usr/local | |
make |
This file contains 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
- (void)dropItBack:(id)sender | |
{ | |
// Position | |
CABasicAnimation *posAnimation = [CABasicAnimation animationWithKeyPath:@"position"]; | |
posAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(self.center.x, self.center.y - 50.f)]; | |
// Opacity | |
CABasicAnimation *opacityAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; | |
opacityAnimation.toValue = [NSNumber numberWithFloat:0.5f]; |
This file contains 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
# Assumes the current user is your 'deploy' user, and has sudo priveledges. | |
sudo apt-get -y upgrade; | |
sudo apt-get -y update; | |
sudo apt-get -y install git-core; | |
sudo apt-get -y install python-software-properties; | |
sudo apt-get -y install build-essential openssl libreadline6 libreadline6-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libpcre3-dev nodejs openjdk-6-jre libmysqlclient-dev; | |
# NGINX | |
sudo add-apt-repository ppa:nginx/stable; |
This file contains 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
- (UITableViewCell *)tableView:(UITableView *)tableView | |
cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
static NSString *CellIdentifier = @"VenueCell"; | |
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; | |
if (!cell) | |
{ | |
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle | |
reuseIdentifier:CellIdentifier]; |
This file contains 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
"use strict"; | |
methods = | |
init: (options) -> | |
$(this).each -> | |
$self = $(@) | |
data = $self.data 'hotttness' | |
settings = |
This file contains 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
require 'RMagick' | |
class PhotoProcessor | |
def self.process(entry_id) | |
entry = Entry.find entry_id | |
raise "The photo for this entry has already been processed" if entry.image_processed? |
This file contains 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 Document: NSDocument { | |
@IBOutlet var fontSizeField: NSTextField? | |
dynamic var currentFontSize: CGFloat = 0 | |
override func windowControllerDidLoadNib(aController: NSWindowController) { | |
super.windowControllerDidLoadNib(aController) | |
fontSizeField.bind("value", | |
toObject: self, | |
withKeyPath: "currentFontSize", |
This file contains 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 Document: NSDocument { | |
@IBAction func fontSizeChanged(sender: NSControl) { | |
var newSize = CGFloat(sender.floatValue) | |
if var font = textView?.typingAttributes[NSFontAttributeName] as? NSFont { | |
font = NSFontManager.sharedFontManager().convertFont(font, toSize: newSize) | |
applyNewAttributes([NSFontAttributeName: font]) | |
} | |
} | |
func applyNewAttributes(attributes: [String: AnyObject]) { |
This file contains 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
func textViewDidChangeTypingAttributes(notification: NSNotification) { | |
if let font = textView?.typingAttributes[NSFontAttributeName] as? NSFont { | |
if let faces = NSFontManager.sharedFontManager().availableMembersOfFontFamily(font.familyName) { | |
// faces is an array of arrays like this: | |
// [[Helvetica, Regular, 5, 0], [Helvetica-Light, Light, 3, 0], [Helvetica-Oblique, Oblique, 5, 1], [Helvetica-LightOblique, Light Oblique, 3, 1], [Helvetica-Bold, Bold, 9, 2], [Helvetica-BoldOblique, Bold Oblique, 9, 3]] | |
fontFacesLabels = faces.map({face in (face[1] as! String)}) | |
} | |
} | |
} |
OlderNewer