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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-fastcgi | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start and stop php-cgi in external FASTCGI mode | |
# Description: Start and stop php-cgi in external FASTCGI mode | |
### END INIT INFO |
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
conn = new Socket; | |
while (true) { | |
// listen on port 80 | |
if (conn.listen (8000)) { | |
// wait forever for a connection | |
var incoming; | |
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 ApplicationJob | |
def self.set_priority(queue, priority) | |
if [:high, :medium, :low].include?(priority) | |
self.instance_eval do | |
@queue = "#{queue}_#{priority}".to_sym | |
end | |
end | |
end | |
end |
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
TUNNEL_USERNAME = "deploy" | |
TUNNEL_HOST = "255.255.255.255" | |
TUNNEL_PORT = 3000 | |
LOCAL_PORT = 3000 | |
desc "Tunnel to a remote host" | |
task :tunnel => :environment do | |
puts "Tunnel established from #{TUNNEL_HOST}:#{TUNNEL_PORT} to 127.0.0.1:#{LOCAL_PORT}" | |
system "ssh -nNT -g -R *:#{TUNNEL_PORT}:127.0.0.1:#{LOCAL_PORT} #{TUNNEL_USERNAME}@#{TUNNEL_HOST}" | |
end |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-fastcgi | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start and stop php-cgi in external FASTCGI mode | |
# Description: Start and stop php-cgi in external FASTCGI mode | |
### END INIT INFO |
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
module AcceptsNestedAttributesFor | |
def should_accept_nested_attributes_for(*models) | |
klass = self.name.gsub(/Test$/, '').constantize | |
models.each do |model| | |
should "accept nested attributes for #{model}" do | |
assert(klass.instance_methods.include?("#{model}_attributes="), | |
"#{klass} does not accept nested attributes for #{model}") | |
end |
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
jQuery.fn.make_attr_unique = function(attr) { | |
var value = $(this).attr(attr); | |
if (value !== undefined) { | |
var value_pieces = value.split(/[0-9]+/); | |
if (value_pieces.length > 1) { | |
$(this).attr(attr, value_pieces[0] + Number(new Date()) + value_pieces[1]); | |
} | |
} | |
}; | |
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/ruby | |
require 'rubygems' | |
require 'open-uri' | |
require 'xml' | |
USERNAME = 'brettbuddin' | |
USE_REAL_NAMES = true # if available | |
ALLOWED_USERS = [] # enter the usernames of those you'd like to see displayed | |
def fetch(url) |
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
server { | |
listen 80; | |
server_name intraspirit.net; | |
root /path/to/public/; | |
index index.php; | |
access_log /path/to/access.log; | |
error_log /path/to/error.log; | |
location / { |
NewerOlder