This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "test_helper" | |
class MixedInTest < ActiveSupport::TestCase | |
include Sauce::SeleniumForTestUnit | |
test "my app" do | |
@browser.open "/" | |
assert @browser.is_text_present("Welcome aboard") | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from selenium import selenium | |
from seldev import sauce_selenium | |
from time import sleep | |
import unittest, time, re | |
class likebutton(unittest.TestCase): | |
def setUp(self): | |
self.verificationErrors = [] | |
# This just creates a selenium object with my credentials and | |
# FF 3.6 on Windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Group < ActiveRecord::Base | |
has_many :projects | |
has_many :personal_blogs | |
has_many :project_events, :through => :projects | |
has_many :blog_events, :through => :personal_blogs | |
has_many :events => # I want both project_events and blog_events | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'Computer.Build' | |
controller = state_machine "ide_controller" do |m| | |
m.input :reset, VHDL::STD_LOGIC | |
m.input :instr_command, VHDL::STD_LOGIC_VECTOR(7..0) | |
m.input :instr_address, VHDL::STD_LOGIC_VECTOR(7..0) | |
m.input :instr_data, VHDL::STD_LOGIC_VECTOR(15..0) | |
m.output :result_command, VHDL::STD_LOGIC_VECTOR(7..0) | |
m.output :result_status, VHDL::STD_LOGIC_VECTOR(7..0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fileutils' | |
ARGV.each do |file| | |
clean_name = file.gsub('%20', ' ') | |
FileUtils.mv(file, clean_name) if clean_name != file | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
startsize=`du -s -h | awk '{print $1}'` | |
find . -name .git -print0 | xargs -0 -n1 -I{} sh -c "cd {}; git gc" | |
endsize=`du -s -h | awk '{print $1}'` | |
echo "$PWD compacted from $startsize to $endsize" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using terms from application "Quicksilver" | |
on process text ThisClipping | |
do shell script "/Users/epall/bin/addreplacement " & ThisClipping | |
end process text | |
end using terms from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is my fantasy for what I should be able to do with RubyGate. | |
# The basic VHDL translation is taken care of at the lowest level, and | |
# then I can build a "computer" DSL on top of it in pure Ruby. The | |
# generated VHDL might not be the fastest, most effiecient, or clearest, | |
# but it's really just an assembly language. | |
computer do |c| | |
c.instruction "add" do |x, y| | |
x+y | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# v: a simple script for intelligently launching MacVim | |
#!/bin/sh | |
open -a /Applications/Vim.app | |
while ! [ `/Applications/Vim.app/Contents/MacOS/Vim --serverlist 2>/dev/null` ] ; do true; done | |
/Applications/Vim.app/Contents/MacOS/Vim --remote-tab $@ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# lastblog: a simple script for checking how recently I've posted to my blogs. | |
# Edit the BLOGS and MAX_ENTRY_INTERVAL globals to suit your tastes. | |
# term/ansicolor is an optional gem that will make the output prettier. | |
require 'rss/1.0' | |
require 'rss/2.0' | |
require 'open-uri' | |
require 'date' |