Skip to content

Instantly share code, notes, and snippets.

@bosko
bosko / GemList_one_liner
Created January 18, 2011 14:07
List all installed gems without versions
ruby -e "%x[gem list].split(\"\n\").each{|l| puts l.split(' ')[0]}"
From 9037f152c9ae2f1f473a926b65b2647ca7730d27 Mon Sep 17 00:00:00 2001
From: Bosko Ivanisevic <[email protected]>
Date: Fri, 17 Sep 2010 11:55:35 +0200
Subject: [PATCH] Fix using Selenium on mingw based Ruby on Windows
---
lib/webrat/selenium/selenium_rc_server.rb | 6 +++---
lib/webrat/selenium/silence_stream.rb | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
@bosko
bosko / 0001-Load-win32console-on-startup.patch
Created September 14, 2010 11:52
RSpec load win32console on start
From f9aa9934e53446e281ed8b054c984d8e314050f5 Mon Sep 17 00:00:00 2001
From: Bosko Ivanisevic <[email protected]>
Date: Tue, 14 Sep 2010 13:41:06 +0200
Subject: [PATCH] Load win32console on startup
At the time color option is set, wrong IO objects are configured
for error and output streams. Win32console must be loaded before
run is called in order to get coloured output on MS Windows.
---
bin/rspec | 6 ++++++
@bosko
bosko / Ruby 1.9.2 rake error
Created August 10, 2010 09:58
Ruby 1.9.2 rake error
d:\projects>pik rake --version
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]
rake, version 0.8.7
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32]
rake, version 0.8.7
ruby 1.9.2dev (2010-07-11) [i386-mingw32]
@bosko
bosko / mssql_list_databases.rb
Created February 24, 2010 11:26
List Databases
require 'activerecord-sqlserver-adapter'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlserver',
:mode => 'ODBC',
:host => '<server>',
:username => '<user_name>',
:password => '<pass>'
:dsn => '<odbc_dsn_name>'
)
@bosko
bosko / persisting_windows_environment_variables.rb
Created August 28, 2009 13:17
A way to change environment variables in Windows and notify processes about change.
# Not my idea. Don't remember where I've picked it up.
# Just stored here for future reference.
require 'win32/registry.rb'
require 'Win32API'
Win32::Registry::HKEY_CURRENT_USER.open('Environment', Win32::Registry::KEY_WRITE) do |reg|
reg['my_value'] = '123'
end
@bosko
bosko / Open in Emacs registry entry
Created February 17, 2009 09:49
Shell extension for "Open In Emacs" pop upmenu
REGEDIT4
[HKEY_CLASSES_ROOT\*\Shell\Open In Emacs]
[HKEY_CLASSES_ROOT\*\Shell\Open In Emacs\Command]
@="c:\\Utils\\emacs-22.3\\bin\\emacsclientw.exe -n \"%1\""