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
(cat <<'EOP' | |
name "base" | |
description "Base role applied to all nodes" | |
override_attributes( | |
"chef_client" => { | |
"server_url" => "https://api.opscode.com/organizations/ORGNAME", | |
"validation_client_name" => "ORGNAME-validator" | |
} | |
) | |
run_list( |
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 Server | |
... | |
pdef_provision = Ruote.process_definition do | |
cursor do | |
provision | |
rewind :if => '${not_ok}' | |
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
> bundle install --path .bundle 7 ↵ ✹ ✭Fetching gem metadata from https://rubygems.org/........ | |
Bundler could not find compatible versions for gem "sexp_processor": | |
In Gemfile: | |
ruote (>= 2.2.0) ruby depends on | |
sexp_processor (~> 3.0) ruby | |
ruote (>= 2.2.0) ruby depends on | |
sexp_processor (4.0.1) |
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
function sedeasy { | |
sed -i "s/$(echo $1 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/$(echo $2 | sed -e 's/[\/&]/\\&/g')/g" $3 | |
} | |
sedeasy "include /etc/nginx/conf.d/*" "include /apps/*/conf/nginx.conf" /etc/nginx/nginx.conf |
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
- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { | |
float rotation; | |
CGRect frame = CGRectMake(0, 0, 480, 320); | |
if (toInterfaceOrientation == UIInterfaceOrientationPortrait) { | |
rotation = 0; | |
frame = CGRectMake(0, 0, 320, 480); | |
} | |
else if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) { | |
rotation = M_PI/2; | |
} |
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
UILabel *messageTextLabel = [[UILabel alloc] init]; | |
messageTextLabel.text = @"Hello World"; | |
CGSize maximumSize = cell.contentView.frame.size; // adjust this. | |
UIFont *font = [UIFont systemFontOfSize:14]; | |
CGSize stringSize = [messageTextLabel.text sizeWithFont:font | |
constrainedToSize:maximumSize | |
lineBreakMode:messageTextLabel.lineBreakMode]; |
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
#import <UIKit/UIKit.h> | |
#import "ABTableViewCell.h" | |
@interface MediaTableViewCell : ABTableViewCell | |
@end | |
@implementation MediaTableViewCell |
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
worker_processes 4; | |
error_log /var/log/nginx/error.log warn; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { |
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
#!/bin/bash | |
# | |
# god Startup script for god (http://god.rubyforge.org) | |
# | |
# chkconfig: - 85 15 | |
# description: God is an easy to configure, easy to extend monitoring \ | |
# framework written in Ruby. | |
# | |
CONF_DIR=/usr/local/god |
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
God.watch do |w| | |
w.name = "nginx" | |
w.interval = 30.seconds | |
w.start = "/etc/init.d/nginx start" | |
w.stop = "/etc/init.d/nginx stop" | |
w.restart = "/etc/init.d/nginx restart" | |
w.start_grace = 10.seconds | |
w.restart_grace = 10.seconds | |
w.pid_file = "/var/run/nginx.pid" |