Skip to content

Instantly share code, notes, and snippets.

View chrismcg's full-sized avatar

Chris McGrath chrismcg

View GitHub Profile
set shiftwidth=2
set bs=2 " allow backspacing in insert mode
set tabstop=2
set autoindent
set smartindent
set expandtab
set smarttab
set number
set nowrap
set encoding=utf8
chris@shiny % ls ~/.vim/plugin
AlignMapsPlugin.vim cecutil.vim gist.vim surround.vim vcscvs.vim
AlignPlugin.vim dbext.vim gitdiff.vim tComment.vim vcsgit.vim
NERD_tree.vim fuzzyfinder.vim project.vim taglist.vim vcssvk.vim
SimpleFold.vim fuzzyfinder_textmate.vim rails.vim tail.vim vcssvn.vim
bufexplorer.vim getscriptPlugin.vim scmdiff.vim vcscommand.vim vimballPlugin.vim
>> Time.parse('01/31/2009').advance(:months => 1)
=> Sat Feb 28 00:00:00 0000 2009
>> Time.parse('01/31/2009').advance(:months => 1).advance(:months => 1)
=> Sat Mar 28 00:00:00 0000 2009
>> Time.parse('01/31/2009').advance(:months => 2)
=> Tue Mar 31 00:00:00 0100 2009
>> Time.parse('01/31/2009').advance(:months => 3)
=> Thu Apr 30 00:00:00 0100 2009
chris@shiny % rake spec:ci
(in /Users/chris/dev/languages/mr-experimental)
./mspec/bin/mspec ci -B ./spec/frozen/macruby.mspec spec/frozen/language spec/frozen/core/io/binmode_spec.rb spec/frozen/core/io/closed_spec.rb spec/frozen/core/io/constants_spec.rb spec/frozen/core/io/each_byte_spec.rb spec/frozen/core/io/fileno_spec.rb spec/frozen/core/io/fsync_spec.rb spec/frozen/core/io/flush_spec.rb spec/frozen/core/io/getc_spec.rb spec/frozen/core/io/io_spec.rb spec/frozen/core/io/inspect_spec.rb spec/frozen/core/io/initialize_copy_spec.rb spec/frozen/core/io/putc_spec.rb spec/frozen/core/io/readchar_spec.rb spec/frozen/core/io/sync_spec.rb spec/frozen/core/io/syswrite_spec.rb spec/frozen/core/io/tell_spec.rb spec/frozen/core/io/to_i_spec.rb spec/frozen/core/io/to_io_spec.rb spec/frozen/core/io/initialize_spec.rb
MacRuby version 0.5 (ruby 1.9.0) [universal-darwin9.0, x86_64]
................................................................EE...
1)
An exception occurred during: before :each
IO#syswrite coerces
## in test/test_helper.rb
class Test::Unit::TestCase
alias unlogged_run run
def run(result, &block)
RAILS_DEFAULT_LOGGER.debug "RUNNING #{self.class} #{@method_name}"
start_time = Time.now
unlogged_run result, &block
time = Time.now - start_time
RAILS_DEFAULT_LOGGER.debug "TIME;#{self.class}#{@method_name.gsub(/,/, '')};#{time}"
:javascript
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"))
:javascript
var pageTracker = _gat._getTracker("YOUR CODE");
pageTracker._setDomainName("YOUR DOMAIN");
pageTracker._initData();
pageTracker._trackPageview();
require 'rubygems'
require 'midiator'
require 'test/unit/ui/console/testrunner'
module Test
module Unit
module UI
module Midi
compile '*' do
case File.extname(item.attributes[:file].path)
when '.markdown'
filter :bluecloth
else
filter :erb
end
layout 'default'
end
This is basically a dirty hack :) I have no idea if messing with the default OSX apache config this way is frowned upon. My view is that it works now, and if it breaks I'll fix it.
Add any domains you want to blacklist to /etc/hosts, pointing at 127.0.0.1. You need to enable web sharing to get apache running of course.
Changes to the default /etc/apache2/httpd.conf
==============================================
Listen 127.0.0.1:80 # so that the world can't see the list
DocumentRoot "/Library/WebServer/Documents/public" # to fit in with passenger, you need to create the public dir (and maybe /tmp too)
require 'rubygems'
require 'ffi'
class Kurl
extend ::FFI::Library
ffi_lib 'libcurl'
CURLOPT_URL = 10002
CURLOPT_WRITEFUNCTION = 20011
CURLOPT_TIMEOUT = 13