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
APACHE_ROOT = 'path/to/apache' | |
def apache(location) | |
File.join APACHE_ROOT, location | |
end | |
def apachectl(command) | |
"#{apache 'bin/apachectl'} -k #{command}" | |
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
class ClassFinder | |
attr_reader :pid | |
def initialize(pid) | |
@pid = pid | |
end | |
def object | |
@object ||= self.class.source_objects.select{|x| x.pid =~ /#{pid}/}.first | |
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
class WorkRequest < ActiveRecord::Base | |
# Attributes include :state_history (text) and :state (string) | |
serialize :state_history, Array | |
after_find :restore_process | |
after_initialize :restore_process | |
def rollback_state_to_previous |
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 NumberTest < ActiveSupport::TestCase | |
def setup | |
@number = 4 | |
end | |
def test_number_is_four | |
assert_equal 4, @number | |
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
class VersionStruct | |
class << self | |
def build_from(version, args = {}) | |
object = deserialize(version.object) | |
args[:changes] = deserialize(version.object_changes) | |
args[:version] = version | |
version_struct = new(object, args) | |
version_struct.mimic | |
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/bash | |
# usage: $0 source_dir [source_dir] ... | |
# where source_dir args are directories containing git repositories | |
red="\033[00;31m" | |
green="\033[00;32m" | |
yellow="\033[00;33m" | |
blue="\033[00;34m" | |
purple="\033[00;35m" |
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 'sinatra/base' | |
require 'httpclient' | |
module Geminabox | |
class Hostess < Sinatra::Base | |
%w[/specs.4.8.gz | |
/latest_specs.4.8.gz | |
/prerelease_specs.4.8.gz |
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 "net/http" | |
require "rexml/document" | |
class GoogleContactList | |
attr_reader :token | |
attr_accessor :response | |
class << self | |
def cache |
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 <span id='jquery_version'></span> | |
<%= javascript_tag do %> | |
var jQueryVersion = jQuery.fn.jquery; | |
$('#jquery_version').html(jQueryVersion); | |
<% 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
require 'typhoeus' | |
LoadError: Could not open library 'libcurl': libcurl: cannot open shared object file: No such file or directory. | |
Could not open library 'libcurl.so': /lib/i386-linux-gnu/libssl.so.1.0.0: symbol CRYPTO_memcmp, version OPENSSL_1.0.0 not defined in file libcrypto.so.1.0.0 with link time reference | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/ffi-1.1.5/lib/ffi/library.rb:121:in `block in ffi_lib' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/ffi-1.1.5/lib/ffi/library.rb:88:in `map' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/ffi-1.1.5/lib/ffi/library.rb:88:in `ffi_lib' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:405:in `<module:Curl>' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:6:in `<module:Typhoeus>' | |
from /home/rob/.rvm/gems/ruby-1.9.3-p286@DbpediaConceptSearch/gems/typhoeus-0.4.2/lib/typhoeus/curl.rb:5:in |