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
*.pbxproj -crlf -diff -merge |
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 CucumberExternalResqueWorker | |
DEFAULT_STARTUP_TIMEOUT = 1.minute | |
COUNTER_KEY = "cucumber:counter" | |
class << self | |
attr_accessor :pid, :startup_timeout | |
def start | |
# Call from a Cucumber support file so it is run on startup | |
return unless Rails.env.cucumber? |
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 ruby | |
# Only works on OS X | |
# Spins up enough `yes > /dev/null` instances inside a | |
# `screen` to use 100% of all your cpu cores | |
# | |
# This just starts screen eating your cores, currently | |
# when you're done you need to kill the screen manually. | |
require "tempfile" |
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
# monit starts with a blank path, so need to declare full paths to stuff | |
check process beefeating_unicorn_rails with pidfile /home/paul/public/beefeatingmonkeys.com/shared/pids/unicorn.pid | |
start program = "/bin/su - paul -c 'cd /home/paul/public/beefeatingmonkeys.com/current;/home/paul/.rvm/gems/ree-1.8.7-2010.02@beefeatingmonkeys/bin/unicorn_rails -D -E production -c config/unicorn.rb'" | |
stop program = "/usr/bin/killall -9 unicorn_rails" as uid paul and gid paul | |
if totalmem is greater than 300 Mb for 5 cycles then alert | |
if cpu is greater than 50% for 2 cycles then alert | |
if cpu is greater than 80% for 3 cycles then restart | |
if loadavg(5min) greater than 10 for 8 cycles then restart |
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
BEGIN { | |
require 'net/http' | |
Net::HTTP.module_eval do | |
alias_method '__initialize__', 'initialize' | |
def initialize(*args,&block) | |
__initialize__(*args, &block) |
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
<phoenixrises> tamonten: you is dad nao? | |
<tamonten> phoenixrises: not yet, but today | |
<Will|> tamonten 2.0 planned for release today? | |
<Will|> I hope everything goes well, no last minute bugs :) | |
<phoenixrises> Will|: child birth isn't like your code ;) | |
<tamonten> well the release date has already slipped, so I'm hoping there was some extra QA done during that time | |
<phoenixrises> tamonten: would hope so, after failing the penetration test 9months ago, you never know what could be going on | |
<tamonten> I think you'll find the penetration test was very successful :P | |
<phoenixrises> tamonten: considering in pen testing you /dont/ want to be able to get in, I think not :P | |
<tamonten> lets leave that analogy before someone mentions backdoors in the system shall we? |
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
desc "Start the resque web interface" | |
task "resque:web" do | |
`rake isolate:sh['resque-web']` | |
end | |
# Task used to preload what's needed for the workers to run properly | |
task "resque:setup" do | |
require File.expand_path(File.join(File.dirname(__FILE__), "../../loaders/gem_sandboxing")) | |
require File.expand_path(File.join(File.dirname(__FILE__), "../../loadpath_initializer")) | |
require File.expand_path('../../../core/loaders/console_initializer', File.dirname(__FILE__)) |
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
#kch: Do we really not have a helper method for array.inject({}){|h,(k,v)|h[k]=v;h}? Not a day goes by that I don't type this. | |
array = [[1, 2], [3, 4]] | |
array.inject({}) {|h,(k,v)| h[k]=v; h } # => {1=>2, 3=>4} | |
Hash[*array.flatten] # => {1=>2, 3=>4} |
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 'uri' | |
require 'psych' | |
require 'net/http' | |
require 'meme' # Install meme_generator | |
module Campfire | |
class API | |
attr_reader :uri, :token, :pass |
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 StatusBarView < NSView | |
attr_reader :progressIndicator, :statusBarItem | |
def initWithStatusBarItem(item) | |
bar = item.statusBar | |
if initWithFrame([[0,0], [bar.thickness, bar.thickness]]) | |
@statusBarItem = item | |
@highlight = false | |
origin, size = frame.origin, frame.size |
OlderNewer