Skip to content

Instantly share code, notes, and snippets.

View knoopx's full-sized avatar

Víctor Martínez knoopx

View GitHub Profile
git new release # creates a new release branch (release/X.Y.Z) from the latest tagged version incrementing minor version from upstream's integration branch
git new release --bump major # creates a new release branch (release/X.Y.Z) from the latest tagged version incrementing major version
git new feature branch-name # creates a new feature branch (feature/branch-name) from upstream's integration branch
git new hotfix branch-name # creates a new hotfix branch (hotfix/branch-name) from upstream's stable branch
$(document).ready(function () {
var TableParser = function () {
function isEmpty(line) {
var empty = true;
$.each(line, function(_, value) {
if (value.trim()) {
empty = false;
return false;
}
@knoopx
knoopx / gist:a6966f6df65680df6b2c
Created October 17, 2014 14:07
change osx shell for current user
sudo dscl . -create ~ UserShell `which fish`
@knoopx
knoopx / bootstrap.sh
Last active August 29, 2015 14:20
Bootstrap new servers
#!/bin/bash
# http://winstonyw.com/2014/10/24/setting_up_ruby_on_rails_on_digital_ocean/
# https://github.com/mattdbridges/capistrano-recipes/blob/master/postgresql.rb
set -euo pipefail
LOCALE="en_US.utf8"
TIMEZONE="Europe/Madrid"
ADMIN_USER="admin"
@knoopx
knoopx / gist:cee46e6267f429cc1fd9
Created April 29, 2015 15:54
parallell-rspec
#!/usr/bin/env bash -e
set -euo pipefail
shopt -s globstar
shopt -s extglob
export RUBY_HEAP_MIN_SLOTS=2000000
export RUBY_HEAP_FREE_MIN=20000
export RUBY_GC_MALLOC_LIMIT=100000000
@knoopx
knoopx / Clear OSX DNS cache
Created February 8, 2010 17:11
Clear OSX DNS cache
dscacheutil -flushcache
@knoopx
knoopx / exception_helper.rb
Created November 9, 2011 14:30 — forked from agibralter/exception_helper.rb
Accessing app errors when using Capybara/Selenium with RSpec
# -*- encoding : utf-8 -*-
# Because Capybara.app gets run by Thin in a separate thread, errors raised in
# the application during request_specs get hidden and just show up in the
# selenium-controller browser as 500 errors with no extra info. This module
# helps us dig into those errors.
module RequestSpecs
module ExceptionHelper
@@last_exception = nil
@knoopx
knoopx / pre-recieve
Last active October 4, 2015 15:11
git push based deployment
#!/usr/bin/env bash
set -xeuf -o pipefail
export DEPLOY_PATH="/home/deploy/mindo.io"
export CURRENT_PATH="$DEPLOY_PATH/current"
export REPO_PATH="$DEPLOY_PATH/repo"
export SHARED_PATH="$DEPLOY_PATH/shared"
export RELEASE_PATH="$DEPLOY_PATH/releases/$(date +%s)"
@knoopx
knoopx / post-commit.rb
Created June 14, 2012 22:04
Gitshots Post-Commit Hook
#!/usr/bin/env ruby
# Requires imagesnap from https://github.com/alexwilliamsca/imagesnap (brew install imagesnap)
# To assemble the video use http://www.dayofthenewdan.com/projects/tlassemble
file="~/.gitshots/#{Time.now.to_i}.jpg"
puts "Taking capture into #{file}!"
system "imagesnap -q -w 3 #{file}"
exit 0
@knoopx
knoopx / boostrap.markdown
Created June 21, 2012 12:07
Setting Up A New Server

Setting up a Rails application on a new server

This guide assumes the following points:

  • You are using a debian-based operating system
  • You would like to deploy your application using RVM, Capistrano and Bundler
  • Your application source code is hosted on a remote GIT repository

Update the operating system