Skip to content

Instantly share code, notes, and snippets.

View sborsje's full-sized avatar
🤘

Stefan Borsje sborsje

🤘
  • Glass — Photography Community
  • Amsterdam, NL
  • X @sborsje
View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'rubygems/command'
require 'rubygems/commands/query_command'
CONFIG_FILE = 'config/gem_installer.yml'
def run
commands = parse_input_file
sources:
- http://gems.rubyforge.org/
- http://gems.github.com/
- http://gems.rubyonrails.org/
gems:
- haml 2.0.4
- rails 2.2.0
# - termios 0.9.4* -- gem install termios -v 0.9.4 --no-rdoc --no-ri
#!/bin/bash
echo "Subversion to Git conversion tool"
echo "---------------------------------"
echo ""
echo "Enter subversion repository url:"
read REPO_URL
echo "$REPO_URL"
" Open ApiDock in a new Safari tab
let g:browser = 'open -a Safari '
" Open the Ruby ApiDock page for the word under cursor
function! OpenRubyDoc(keyword)
let url = 'http://apidock.com/ruby/'.a:keyword
exec '!'.g:browser.' '.url.' &'
endfunction
noremap RB :call OpenRubyDoc(expand('<cword>'))<CR>
#!/bin/sh
#
# Bash/AppleScript to automagically setup Rails development environment.
# This script opens a terminal windows, maximizes it and opens 4 tabs with:
# - autospec
# - tail -f development.log
# - script/console
# - mvim in the project folder
#
# Run this script with theproject path as argument, ea:
# Host based routing - enables routes like:
# map.connect '', :controller => 'blah', :action => 'blah', :conditions => {:host => 'blah'}
#
# Put this file in /config/initializers
module ActionController
module Routing
class Route
def recognition_conditions_with_host
result = recognition_conditions_without_host
@sborsje
sborsje / soap_responses.xml
Created January 9, 2010 01:49
Attempt to spec a handsoap service
<!-- AUTHORISE -->
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<ns1:authoriseResponse xmlns:ns1="http://payment.services.adyen.com">
<ns1:paymentResult>
<additionalData xmlns="http://payment.services.adyen.com" xsi:nil="true"/>
<authCode xmlns="http://payment.services.adyen.com">1234</authCode>
<dccAmount xmlns="http://payment.services.adyen.com" xsi:nil="true"/>
function! DoPrettyXML()
" save the filetype so we can restore it later
let l:origft = &ft
set ft=
" delete the xml header if it exists. This will
" permit us to surround the document with fake tags
" without creating invalid xml.
1s/<?xml .*?>//e
" insert fake tags around the entire document.
" This will permit us to pretty-format excerpts of
IPv4_PART = /\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]/ # 0-255
REGEXP = %r{
\A
https?:// # http:// or https://
([^\s:@]+:[^\s:@]*@)? # optional username:pw@
( (xn--)?[^\W_]+([-.][^\W_]+)*\.[a-z]{2,6}\.? | # domain (including Punycode/IDN)...
#{IPv4_PART}(\.#{IPv4_PART}){3} ) # or IPv4
(:\d{1,5})? # optional port
([/?]\S*)? # optional /whatever or ?whatever
\Z
gemdoc() {
local gems=($(gem env gemdir)/doc/$1*/rdoc/index.html)
open ${gems[@]: -1}
}
complete -W '$(`which ls` $(gem env gemdir)/doc)' gemdoc