Skip to content

Instantly share code, notes, and snippets.

@ematta
ematta / ubuntu-ruby-gem-watir-install
Created May 12, 2011 13:51
Ubuntu Installation of Ruby, Gems, and WATIR
sudo apt-get install ruby
wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
tar xvzf rubygems-1.7.2.tgz
cd rubygems-1.7.2
sudo ruby setup.rb
ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system
sudo gem install watir
@ematta
ematta / .irbrc
Last active October 11, 2015 23:57
My .irbrc file
require 'irb/completion'
require 'irb/ext/save-history'
require 'map_by_method'
require 'what_methods'
require 'pp'
IRB.conf[:AUTO_INDENT] = true
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" #FOR WINDOWS CHANGE HOME TO HOMEPATH
class Application < Sinatra::Base
configure do
enable :static
set :views, File.join(File.dirname(__FILE__), 'views')
end
get '/' do
slim :index
end
# change foo to your library name
# change Foo::Database to your Sequel database
namespace :bundler do
task :setup do
require 'rubygems'
require 'bundler/setup'
end
end
#!/usr/bin/env ruby
require 'spreadsheet'
# Begin Test
print "Spreadsheet Test\n"
# Create the rows to be inserted
row_1 = ['A1', 'B1']
row_2 = ['A2', 'B2']
@ematta
ematta / ags-install
Last active January 1, 2016 22:39
How to install AGS on Fedora
# Install AGS in Fedora 20
# https://github.com/adventuregamestudio/ags/blob/master/debian/README.md
# Change this to whatever you use for home dir apps
cd ~/app
git clone git://github.com/adventuregamestudio/ags.git
cd ags
sudo yum -y install python-devel freetype-devel libvorbis-devel allegro-devel allegro libtheora libtheora-devel dumb-devel dumb
make --directory=Engine
sudo make --directory=Engine install
@ematta
ematta / watir-aspnet-postback-workaround.rb
Last active January 4, 2016 18:19
ASP.NET Postback issue work around
browser = Watir::Browser.new :ie
browser.goto http://yourlegacyaspdotnetpage
browser.text_field(:id => 'this_field will_force_a_post_back').set ('This is gonna suck')
browser.send_keys :tab
Watir::Wait.until { browser.ready_state.eql? "complete" }
# Rest of your code

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
Sequel.migration do
up do
# Table: Burndown Project
# String: Name - The name of the project
# String: Description - Short description of the project
create_table(:burndown_project) do
primary_key :id
String :name
String :description
end