Skip to content

Instantly share code, notes, and snippets.

View beccasaurus's full-sized avatar

Rebecca Taylor beccasaurus

View GitHub Profile
@beccasaurus
beccasaurus / addLabelsToRallyIterationView.css
Last active December 16, 2015 01:30
Example of minimum Chrome content script for customizing Rally (adds "Labels" to links in Iteration Status table)
span.custom-rally-label {
border-radius: 3px;
display: inline-block;
padding: 2px 4px;
font-weight: bold;
color: white;
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25);
white-space: nowrap;
vertical-align: baseline;
background-color: #0d2d78;
#! /usr/bin/env ruby
require 'rack'
require 'thin'
directory = ARGV[0] || Dir.pwd
directory = File.expand_path(directory)
puts "Serving #{directory}"
port = (ARGV[1] || 3000).to_i
puts "http://localhost:#{port}/"
@beccasaurus
beccasaurus / index.html
Created April 3, 2013 21:47
Run arbitrary code in Dartium
<!DOCTYPE html>
<html>
<head>
<style>
textarea { width: 100%; height: 150px; }
</style>
<script>
window.addEventListener('keydown', function(e) {
if ((e.keyCode == 10 || e.keyCode == 13) && event.ctrlKey)
run();
@beccasaurus
beccasaurus / example.html
Created March 9, 2013 01:29
Petite JavaScript test library. Just add .test elements to your page. If you include a code element, the code will be run. Return true/false to pass/fail the test.
<!DOCTYPE html>
<html>
<head>
<script src='petitest.js'></script>
<link rel='stylesheet' href='petitest.css' />
</head>
<body>
<h1 id='header'>Hello world!</h1>
<a id='change-link' href='#' onclick='document.getElementById("header").textContent = "Changed!";'>Change Header</a>
@beccasaurus
beccasaurus / setup.sh
Last active December 14, 2015 15:09
minimal ubuntu setup (I'll add to this slowly, but surely, over time ... experiment!)
#! /bin/sh
#
# *MINIMAL* setup script
#
sudo aptitude install vim git nginx
# make nginx serve your home directory
sudo rm -rf /usr/share/nginx/www
@beccasaurus
beccasaurus / goto-branch.sh
Last active January 5, 2023 15:34
Quick hack for checkout git branches into different directories (for when I'm actively working on different branches and want different working directories)
# Working on lots of different branches of different repos
# has been a pain lately, especially when trying to address
# issues in multiple branches at once.
GOTO_BRANCH_DIR="$HOME/.goto-branch"
GOTO_BRANCH_REPOS="$GOTO_BRANCH_DIR/repos"
GOTO_BRANCH_BRANCHES="$GOTO_BRANCH_DIR/branches"
_goto-branch_usage() {
echo "Usage: goto-branch repo-name [branch-name | master]"
source :rubygems
gem 'capybara'
gem 'rspec'
@beccasaurus
beccasaurus / config.ru
Created August 27, 2012 01:25
Example of how to dispatch requests from 1 Rack application out to different Rack apps
apps = {
'localhost.first' => ->(env) { [200, {'Content-Type' => 'text/plain'}, ['App 1']] },
'localhost.second' => ->(env) { [200, {'Content-Type' => 'text/plain'}, ['App 2']] }
}
run ->(env) do
request = Rack::Request.new(env)
if app = apps[request.host]
app.call(env)
@beccasaurus
beccasaurus / README.md
Created July 31, 2012 04:08
Playing with Dart Milestone 1 Language Changes
@beccasaurus
beccasaurus / contenteditable.html
Created June 25, 2012 06:39
Playing around with contenteditable=true
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
function write() {
var $out = $("#output");
$out.text($out.text() + "\n" + JSON.stringify(arguments));
}