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
# my custom monitoring configuration for applications other than rails | |
# This monitors a PHP beanstalk worker process | |
# run in non-daemonized mode (so you can monitor it) with `god -c /path/to/mysql.god -D` | |
# run normally with `god -c /path/to/mysql.god` | |
# the workers will have a name like such beanstalk-worker-app_directory ie beanstalk-worker-development | |
# Settings for email notifications (optional) | |
God::Contacts::Email.defaults do |d| |
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
/home/deploy/APPNAME/current/log/*.log { | |
daily | |
missingok | |
rotate 7 | |
compress | |
delaycompress | |
notifempty | |
copytruncate | |
} |
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/env ruby | |
require 'net/https' | |
https = Net::HTTP.new('encrypted.google.com', 443) | |
https.use_ssl = true | |
https.verify_mode = OpenSSL::SSL::VERIFY_PEER | |
https.request_get('/') |
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
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
int count = 0; | |
string temp = ""; | |
while (count < 10) | |
{ |
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
NSDictionary *systemVersionDictionary = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"]; | |
NSString *reqSysVer = @"10.7"; | |
NSString *currSysVer; | |
currSysVer = [systemVersionDictionary objectForKey:@"ProductVersion"]; | |
// For testing | |
// currSysVer = @"10.10"; | |
if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) | |
NSLog(@"Version requirement met"); | |
else | |
NSLog(@"Version requirement not met"); |
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
speed <- 55 | |
distance <- 2 | |
speeds <- seq(54, 0) | |
h <- function(x) ceiling((distance / (speed - x)) * 3600) | |
g <- Vectorize(h) | |
times = g(speeds) |
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 "canopy.js" | |
cacheControls(); | |
verifyText('notclicked', "Not Clicked"); | |
tap("clickme"); | |
verifyText('notclicked', "Clicked"); |
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
describe('Model', function(){ | |
it('something', function(done){ | |
request('http://google.com', function(response){ | |
console.log(response); | |
done(); | |
}) | |
}); | |
}); |
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
require "#{File.dirname(__FILE__)}/../lib/transactions.rb" | |
include Transactions | |
def capture_stdout(&block) | |
original_stdout = $stdout | |
$stdout = fake = StringIO.new | |
begin | |
yield | |
ensure | |
$stdout = original_stdout |