Skip to content

Instantly share code, notes, and snippets.

Avatar
🔎
hunting for code to clean up

M. Scott Ford mscottford

🔎
hunting for code to clean up
View GitHub Profile
View CI Design Brainstorm.md

Continuous Integration Brainstorm

I spent some time today looking for a good continuous integration server that was ruby friendly and user friendly. I did not like my choices. So I decided that I would come up with my wish list for what I want a CI solution to look like. Here goes.

Problems

This is the list of problems that I would like to solve with a new CI solution. (Yeah! I want to reinvent the wheel!)

  • Is it running?
    • There needs to be a very easy way to determine if the server is running.
@mscottford
mscottford / update-dns.rb
Created May 24, 2010
Uses the Rackspace Apps control panel website to update the DNS A record for a subdomain.
View update-dns.rb
#!/usr/bin/ruby
require 'rubygems'
require 'steam'
require 'net/http'
require 'resolv'
require 'mail'
class DnsUpdateBot
def initialize
@mscottford
mscottford / demo.html
Created Jun 30, 2010
jQuery plugin that protects the selection of textareas when jQuery UI buttons are clicked.
View demo.html
<!DOCTYPE html>
<html lang='en'>
<head>
<script src="js/jquery-1.4.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery-ui-1.8.2.custom.min.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="css/black-tie/jquery-ui-1.8.2.custom.css" type="text/css" media="screen" title="no title" charset="utf-8">
<style type="text/css" media="screen">
html {
font-size: 11px;
font-family: arial;
@mscottford
mscottford / gist:768002
Created Jan 6, 2011
Fun with PHP's $this variable (PHP 5.2)
View gist:768002
Interactive shell
php > class Foo {
php { public function invoke() {
php { print(get_class($this));
php { }
php { }
php > class Bar {
php { public function invoker() {
php { $foo = new Foo();
@mscottford
mscottford / rvm_prompt.bash
Created Jan 28, 2011
bash script that displays the current ruby in use by rvm as part of the prompt
View rvm_prompt.bash
function red_text {
local LIGHT_RED="\[\033[1;31m\]"
local NO_COLOR="\[\033[0m\]"
echo "$LIGHT_RED$1$NO_COLOR"
}
function green_text {
local LIGHT_GREEN="\[\033[1;32m\]"
local NO_COLOR="\[\033[0m\]"
echo "$LIGHT_GREEN$1$NO_COLOR"
@mscottford
mscottford / AppController.h
Created Aug 2, 2011
MacRuby IB Outlets and Actions Workaround
View AppController.h
#import <Foundation/Foundation.h>
@interface AppController : NSObject {
NSComboBox *seriesCombo;
NSComboBox *titleCombo;
NSButton *readButton;
}
@property IBOutlet NSComboBox *seriesCombo;
@property IBOutlet NSComboBox *titleCombo;
View gist:1371618
cloudraker:mcsweeneys mscottford$ bundle exec rake db:migrate
rake aborted!
dlopen(/Users/mscottford/.rvm/gems/ruby-1.9.3-p0@mcsweeneys/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9): Symbol not found: _ruby_current_thread
Referenced from: /Users/mscottford/.rvm/gems/ruby-1.9.3-p0@mcsweeneys/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
Expected in: flat namespace
in /Users/mscottford/.rvm/gems/ruby-1.9.3-p0@mcsweeneys/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/mscottford/.rvm/gems/ruby-1.9.3-p0@mcsweeneys/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
(See full trace by running task with --trace)
View gist:1435300
/Users/mscottford/src/railsdog/mcsweeneys/config/initializers/10_cas.rb:1: warning: already initialized constant CAS
undefined local variable or method `new_action' for Admin::VariantsController:Class (NameError)
/Users/mscottford/.rvm/gems/ruby-1.9.2-p290@mcsweeneys/gems/spree_core-0.70.3/app/controllers/admin/variants_controller.rb:4:in `<class:VariantsController>'
/Users/mscottford/.rvm/gems/ruby-1.9.2-p290@mcsweeneys/gems/spree_core-0.70.3/app/controllers/admin/variants_controller.rb:1:in `<top (required)>'
/Users/mscottford/.rvm/gems/ruby-1.9.2-p290@mcsweeneys/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `require'
/Users/mscottford/.rvm/gems/ruby-1.9.2-p290@mcsweeneys/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:240:in `block in require'
/Users/mscottford/.rvm/gems/ruby-1.9.2-p290@mcsweeneys/gems/activesupport-3.1.1/lib/active_support/dependencies.rb:225:in `load_dependency'
/Users/mscottford/.rvm/gems/ruby-1.9.2-p290@mcsweeneys/gems/activesupport-3.1.1/lib/active_sup
@mscottford
mscottford / application.rb
Created Jan 10, 2012
spree calculator issue
View application.rb
module Mcsweeneys
class Application < Rails::Application
# snip
config.to_prepare do
## snip
Spree::Environment::Calculators.class_eval do
attr_accessor :handling_fees
end
end
View gist:1893250
cloudraker:mcsweeneys mscottford$ irb
1.9.3p0 :001 > a = Object.new
=> #<Object:0x007f7f59c09538>
1.9.3p0 :002 > Object.class_eval { def foo; puts 'wow'; end; }
=> nil
1.9.3p0 :003 > a.foo
wow
=> nil
1.9.3p0 :004 > b = Object.new
=> #<Object:0x007f7f59c19b18>
You can’t perform that action at this time.