Skip to content

Instantly share code, notes, and snippets.

@jasoncodes
jasoncodes / README
Last active May 1, 2024 21:29
Remote Chrome browser for Capybara
On the shared machine:
Download http://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.33.0.jar&can=2&q=
$ brew install chromedriver
$ java -jar selenium-server-standalone-2.33.0.jar
On the local machine:
Set `CHROME_HOSTNAME` in your `.env`, `.rbenv_vars`, or per run.
@jasoncodes
jasoncodes / README
Last active August 14, 2023 03:29
Notion uncheck all bookmarklet
A simple bookmarklet to uncheck all the checkboxes (including nested checkboxes) in the current Notion document.
Minified using http://chriszarate.github.io/bookmarkleter/.
@jasoncodes
jasoncodes / README.markdown
Created October 6, 2010 11:16
Run VMware Fusion headless at Mac OS system startup

Run VMware Fusion headless at Mac OS system startup.

I heard you like headless VMs on your Mac so I wrote this script for your launchds.

Assumptions

  • Tested on Mac OS X 10.6.4 with VMware Fusion 2.0.5 and 3.1.1.
  • A interactive user automatically logs into the system at startup. I had some issues trying to get this running without an interactive user logged in. I automatically log in for Airfoil Speakers anyway.
  • Your virtual machines live in /Virtual Machines
@jasoncodes
jasoncodes / README
Created September 19, 2018 03:43
JSON bookmarklet
A basic bookmarklet to make JSON readable.
Minified using http://chriszarate.github.io/bookmarkleter/.
@jasoncodes
jasoncodes / gist:1223731
Created September 17, 2011 07:45
Installing Ruby 1.9.3 with rbenv on OS X
# The latest version of this script is now available at
# https://github.com/jasoncodes/dotfiles/blob/master/aliases/rbenv.sh
VERSION=1.9.3-p286
brew update
brew install rbenv ruby-build rbenv-vars readline ctags
if [ -n "${ZSH_VERSION:-}" ]; then
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.zshrc
else
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
@jasoncodes
jasoncodes / Apple Terminal.itermcolors
Created May 11, 2011 23:18
iTerm colours that resemble Apple's Terminal.app defaults
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
@jasoncodes
jasoncodes / create_item_children_count.rb
Created October 23, 2011 19:04
Create ActiveRecord models for database views
class CreateItemChildrenCountView < ActiveRecord::Migration
def self.up
execute <<-SQL
CREATE VIEW item_children_count AS
SELECT parent_id AS item_id, COUNT(*) as children_count
FROM items GROUP BY parent_id;
SQL
end
def self.down
@jasoncodes
jasoncodes / README
Last active June 29, 2018 01:30
Expand GitHub Pull Requests
Show outdated comments and large diffs on GitHub Pull Requests.
Minified using http://chriszarate.github.io/bookmarkleter/.
require 'bundler'
Bundler.configure
require 'bundler/inline'
gemfile do
source 'http://rubygems.org'
gem 'activesupport', require: 'active_support/all'
gem 'aws-sdk-s3'
gem 'parallel'
#!/usr/bin/env perl
use strict;
use warnings FATAL => 'all';
{
package pushd;
use Cwd qw(getcwd chdir);
sub new {