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 sh | |
# A simple script to open a new tab in Terminal in the current directory | |
# Author: Eric Allen | |
osascript -e 'tell application "System Events" to tell process "Terminal" to keystroke "t" using command down' > /dev/null | |
osascript -e "tell application \"Terminal\" to do script \"cd $PWD && clear\" in window 1" > /dev/null |
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 TestController < ApplicationController | |
def rubyversion | |
text = `which ruby` | |
text += "<br>" | |
text += "<br>" | |
text += `ruby --version` | |
text += "<br>" | |
text += "<br>" | |
text += `gem list --local`.split("\n").join("<br>") | |
render :text => text |
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/ruby | |
file = File.open('orders.tsv') | |
out = File.open('orders.csv', 'w') | |
file.each_line do |line| | |
fields = line.split("\t") | |
out.puts '"'+fields.join('","')+'"' | |
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
#!/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' |
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
# 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
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
#!/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
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
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) |
OlderNewer