Skip to content

Instantly share code, notes, and snippets.

@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')
@joho
joho / gist:3735740
Created September 17, 2012 05:40 — forked from rafaelss/gist:3700977
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
@eternalstorms
eternalstorms / NSSharingServicePicker+ESSSharingServicePickerMenu.h
Created November 22, 2012 18:50
A category on NSSharingServicePicker to create a menu that can be used as a sharing submenu or main menu
//
// NSSharingServicePicker+ESSSharingServicePickerMenu.h
//
// Created by Matthias Gansrigler on 22.11.12.
// Copyright (c) 2012 Eternal Storms Software. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSSharingServicePicker (ESSSharingServicePickerMenu)
@8bitDesigner
8bitDesigner / .powrc
Last active December 28, 2015 22:09 — forked from nbibler/gist:5307941
Everything you need to use RVM _sanely_.
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
web: node index.js
@insidegui
insidegui / gist:4bc3818e99233f9bf756
Created August 2, 2014 17:00
QTX Window with FOTWindow
_window.titleBarDrawingBlock = ^(BOOL drawsAsMainWindow, NSRect drawingRect, NSBezierPath *clippingPath){
NSColor* fillColor = [NSColor colorWithCalibratedRed: 0.076 green: 0.073 blue: 0.076 alpha: 1];
NSColor* strokeColor = [NSColor colorWithCalibratedRed: 0.289 green: 0.289 blue: 0.289 alpha: 1];
NSColor* gradientColor = [NSColor colorWithCalibratedRed: 0.179 green: 0.179 blue: 0.179 alpha: 1];
NSColor* shadowColor2 = [NSColor colorWithCalibratedRed: 0.719 green: 0.714 blue: 0.719 alpha: 1];
NSGradient* gradient = [[NSGradient alloc] initWithColorsAndLocations:
strokeColor, 0.0,
gradientColor, 0.50,
fillColor, 0.51, nil];
@jendiamond
jendiamond / 1railsgirlsla_part1_tutorial.md
Last active January 10, 2022 05:43
Rails Girls LA Guide
@marteinn
marteinn / MSButtonTextTopCell.h
Last active April 26, 2021 04:36
NSButton example: Vertical aligning text in a NSButton
//
// MSButtonTextTopCell.h
// <Project>
//
// Created by Martin Sandström on 2015-09-23.
// Copyright (c) 2015 Martin Sandström. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@evantoli
evantoli / GitConfigHttpProxy.md
Last active July 20, 2024 03:29
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like: