Skip to content

Instantly share code, notes, and snippets.

@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@mbostock
mbostock / .block
Last active February 8, 2016 23:13
Labeled points
license: gpl-3.0
@henrik242
henrik242 / p4merge
Last active January 5, 2023 22:23
Helper script for p4merge and Git on MacOSX
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/P4Merge.app/Contents/Resources/launchp4merge "${absargs[@]}"
@dannygarcia
dannygarcia / SublimeLinter.sublime-settings
Created April 21, 2012 00:02
Sublime Linter User Settings
{
"jshint_options" :
{
"adsafe": false,
"bitwise": false,
"newcap": true,
"eqeqeq": true,
"immed": true,
"nomen": false,
"onevar": true,
@hzlzh
hzlzh / gist:3128038
Created July 17, 2012 08:31
console.log() snippet for Sublime Text 2
<snippet>
<!-- put this file in /packages/User/<Folder Name>/console_log.sublime-snippet then restart your Sublime Text 2 -->
<content><![CDATA[console.log($1);$0]]></content>
<tabTrigger>conl</tabTrigger>
<scope>text.html,source.js</scope>
<description>console.log()</description>
</snippet>
<snippet>
<!-- put this in another file /packages/User/<Folder Name>/console_dir.sublime-snippet then restart your Sublime Text 2 -->
@LBRapid
LBRapid / keypress.rb
Created September 21, 2012 18:03
Simulate keyup event in a request spec with capybara/poltergeist
keypress_script = "var e = $.Event('keyup', { keyCode: 13 }); $('#main-search-input').trigger(e);"
page.driver.execute_script(keypress_script)
@ninthspace
ninthspace / gist:4360267
Last active November 9, 2018 12:03
How I migrated from rbenv to chruby, and kept per-project gems nice and tidy.

Remove rbenv and any rubies, gems etc.:

$ rm -rf ~/.rbenv

Uninstall rbenv if installed via Homebrew

$ brew uninstall rbenv

Remove references to rbenv in ~/.bash_profile etc.

@kewah
kewah / css-animation.js
Created January 9, 2013 14:49
JavaScript snippet to get CSS Animation event types (animationstart, animationend, animationiteration).
var CSSAnimation = (function(window, document, undefined) {
'use strict';
function camelCaseEventTypes(prefix) {
prefix = prefix || '';
return {
start: prefix + 'AnimationStart',
end: prefix + 'AnimationEnd',
iteration: prefix + 'AnimationIteration'
@jcleveley-zz
jcleveley-zz / dev_tools_osx.md
Last active December 12, 2015 10:39
Dev setup for osx