Skip to content

Instantly share code, notes, and snippets.

View filipebarcos's full-sized avatar

Filipe Costa filipebarcos

View GitHub Profile
# Sometimes, especially when working with JSON APIs,
# when testing I found myself wanting to test the "shape" of data and
# only some particular elements, rather than either:
#
# 1. test everything - which is tricky with things like auto_increment primary keys,
# created_at fields etc
# 2. test only subset of data - do stuff like:
# `JSON(response.body).map { |h| h['name'] }.should == ['Item 1', 'Item 2']
#
# Here, I want to try something different. See:
@lrytz
lrytz / z-automator.png
Last active February 4, 2023 21:20
Shortcut for Syntax Highlighting in Keynote
@zenorocha
zenorocha / .hyper.js
Last active November 12, 2023 15:13 — forked from millermedeiros/osx_setup.md
Setup macOS Sierra (10.12)
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 14,
// font family with optional fallbacks
@murbanski
murbanski / whatwedeploy.sh
Created October 16, 2013 10:41
What will we deploy?
#!/usr/bin/env sh
git log origin/production..master --no-merges --pretty=format:%s |
egrep -o "[0-9]{6,}" |
xargs -n1 -I :story_id echo "https://www.pivotaltracker.com/story/show/:story_id"
@pixelhandler
pixelhandler / pre-push.sh
Last active April 8, 2024 01:04
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@mrrooijen
mrrooijen / Capistrano-Deployment-Recipe.rb
Created July 29, 2009 09:34
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment: