Skip to content

Instantly share code, notes, and snippets.

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
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
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
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)
require 'fileutils'
ARGV.each do |file|
clean_name = file.gsub('%20', ' ')
FileUtils.mv(file, clean_name) if clean_name != file
end
@epall
epall / compact.sh
Created January 10, 2010 23:22
Garbage collect all git repos in the current directory
#!/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"
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 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
@epall
epall / v
Created October 21, 2009 18:58
# 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 $@
@epall
epall / lastblog.rb
Created September 7, 2009 17:44
lastblog.rb: 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.
#!/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'