Skip to content

Instantly share code, notes, and snippets.

Avatar
🧐

Simon Eskildsen sirupsen

🧐
View GitHub Profile
View tests.watchr
ENV["WATCHR"] = "1"
system 'clear'
def growl(message)
growlnotify = `which growlnotify`.chomp
title = "Watchr Test Results"
image = message.include?('0 failures, 0 errors') ? "~/.watchr_images/passed.png" : "~/.watchr_images/failed.png"
options = "-w -n Watchr --image '#{File.expand_path(image)}' -m '#{message}' '#{title}'"
system %(#{growlnotify} #{options} &)
end
@vangberg
vangberg / DWM-ON-OS-X.md
Created Feb 22, 2010
dwm on os x [work in progress!]
View DWM-ON-OS-X.md

Installing and configuring dwm on OS X

  1. Install XQuartz (http://xquartz.macosforge.org) which is the development version of the X11.app that ships with OS X, which means it is way more up to date. I have had some weird issues with X11.app v. 2.3-something. XQuartz 2.5.0 fixed that.

  2. Install dwm from Homebrew, brew install dwm. This makes a bunch of necessary tweaks to the DWM configuration.

  3. Add the following script to $PATH, name it dwm-launch and chmod 755:

    cd ~
    

while true

@tmm1
tmm1 / gist:329682
Created Mar 11, 2010
EM Chat Server Demo
View gist:329682
require 'rubygems'
require 'eventmachine'
require 'em-http' # gem install em-http-request
require 'yajl' # gem install yajl-ruby
class String
def bold
"\033[1m#{self}\033[0m"
end
end
View gist:556286
#On branch search
$ git checkout -b TEMP-search
Switched to a new branch 'TEMP-search'
$ git fetch http://github.com/Sirupsen/gollum.git search
got 7ab77dbde50779f13e7b3eddad719d1fcb345e0b
...
got 144d612dd6563f71319e63b3dc5726ed9102be1c
View gist:581868
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
View github_omniauth_sinatra.rb
require 'sinatra'
require 'omniauth'
class Application < Sinatra::Base
use OmniAuth::Builder do
provider :github, 'github_id', 'github_secret'
end
get '/' do
@tenderlove
tenderlove / person_test.rb
Created Feb 10, 2011
Use minitest/spec with Rails 3
View person_test.rb
require 'test_helper'
require 'minitest/autorun'
module Tenderlove
class Spec < MiniTest::Spec
include ActiveSupport::Testing::SetupAndTeardown
include ActiveRecord::TestFixtures
alias :method_name :__name__ if defined? :__name__
self.fixture_path = File.join(Rails.root, 'test', 'fixtures')
@ryanb
ryanb / favorite_gems.md
Created Mar 4, 2011
A list of my favorite gems for various tasks.
View favorite_gems.md
View gist:893184
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
class BuildStatusTest < ActiveSupport::TestCase
test "remove the old statii" do
assert_equal 2, BuildStatus.count
BuildStatus.expire_old
statii = BuildStatus.all
assert_equal 1, statii.size
assert statii[0].updated_at >= 30.days.ago
end
View web_services.md

Different services I can suggest when a non-tech friend or family member asks me how they can cheaply make a website and possibly use it to sell stuff online.

Website Hosting