Skip to content

Instantly share code, notes, and snippets.

View monde's full-sized avatar
🐲

Mike Mondragon monde

🐲
  • Okta
View GitHub Profile
@monde
monde / railsvim.sh
Created July 23, 2008 15:24
launch gvim and autotest in an gnome terminal side by side
#!/bin/bash
DIR="${1}"
if [ ! -d "${DIR}" ]; then
echo "call me with a directory, e.g.:"
echo "${0} /some/path/to/dir"
exit 1
fi
gnome-terminal --geometry=130x35+345+250 \
# this file resides in dev_tools/github.rb of mms2r's project
# based on Trouble shooting section in http://gems.github.com/
require 'rubygems'
require 'rubygems/specification'
data = File.read(File.join(File.dirname(__FILE__), "..", "mms2r.gemspec"))
spec = nil
result = Thread.new { spec = eval("$SAFE = 3\n#{data}") }.join
puts spec
(!!result) ? exit(0) : exit(1)
# a test harnessing the exit result from dev_tools/github.rb
require 'test/unit'
require 'rubygems'
class TestGithub < Test::Unit::TestCase
def test_build_github_gem
result = `ruby #{File.join(File.dirname(__FILE__), "..", "dev_tools", "github.rb")}`
puts result
assert_equal 0, $?.exitstatus
def self.notify title, msg, img, pri='low', time=5000
msg.gsub!("'", '"')
folder = "/usr/share/icons/gnome/16x16/emblems/"
`notify-send -i #{folder}#{img} -u #{pri} -t #{time} '#{msg}'`
end
def self.notify title, msg, img, pri='low', time=5000
msg.gsub!("'", '"')
folder = "/usr/share/icons/gnome/16x16/emblems/"
`notify-send -i #{folder}#{img} -u #{pri} -t #{time} '#{msg}'`
end
To: wsualum@wsu.edu, PresidentsOffice@wsu.edu
From: Mike Mondragon <-------------@gmail.com>
Date: Thu, 16 Apr 2009 15:52:28 -0700
Subject: Apple Cup permanently moving to Qwest Field
President Floyd, WSU Alumni Association:
I would like to express my disapproval of even considering moving the
Apple Cup permanently to Qwest Field. I live next to Seattle so it
would be convenient for me, but it would erode yet another tradition
mike@daisy 10041 ~/builds/memcached-1.2.8$ sudo gem install peep -- --with-memcached-include=/usr/local/include/libmemcached/
Building native extensions. This could take a while...
ERROR: Error installing peep:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb --with-memcached-include=/usr/local/include/libmemcached/
checking for #include <memcached.h>
... yes
checking for sys/ptrace.h... yes
checking for sys/ptrace.h... yes
#! /bin/sh
# /etc/init.d/sphinx: start the sphinx search daemon.
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin
PIDFILE=/opt/local/var/db/sphinx/log/searchd.pid
BINPATH=/usr/local/bin/searchd
SPHINX="--config /etc/sphinx/sphinx.conf"
require 'rubygems'
require 'dynect'
# For accessing Dynamic Network Services, Inc. DNS services.
# Use Dynect gem to update a CNAME with an EC2 Private DNS name
# http://rubyforge.org/projects/dynect/
# by Mike Mondragon mikemondragon _AT_ gmail
customer = ENV['DNECT_CUSTOMER']
username = ENV['DNECT_USERNAME']
@monde
monde / dirtygitprompt.sh
Created October 23, 2009 19:30
verbose dirty git prompt
# origin of work http://henrik.nyh.se/2008/12/git-dirty-prompt
function parse_git_dirty {
status=`git status 2> /dev/null`
dirty=` echo -n "${status}" 2> /dev/null | grep -q "Changed but not updated" 2> /dev/null; echo "$?"`
untracked=`echo -n "${status}" 2> /dev/null | grep -q "Untracked files" 2> /dev/null; echo "$?"`
ahead=` echo -n "${status}" 2> /dev/null | grep -q "Your branch is ahead of" 2> /dev/null; echo "$?"`
newfile=` echo -n "${status}" 2> /dev/null | grep -q "new file:" 2> /dev/null; echo "$?"`
renamed=` echo -n "${status}" 2> /dev/null | grep -q "renamed:" 2> /dev/null; echo "$?"`
bits=''
if [ "${dirty}" == "0" ]; then