Skip to content

Instantly share code, notes, and snippets.

View knoopx's full-sized avatar

Víctor Martínez knoopx

View GitHub Profile
@knoopx
knoopx / gh.pp
Created November 15, 2013 23:13
file { "/home/${username}/.ssh/authorized_keys":
mode => 644,
owner => $username,
group => $username,
source => "https://github.com/knoopx.keys"
}
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
@knoopx
knoopx / mac-bootstrap.sh
Last active March 10, 2022 16:18
mac bootstrap osx
# change modifier keys
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install mas
mas upgrade
# core utils
brew install findutils ssh-copy-id unrar wget git hub gnutls gnu-tar trash fzf
$(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:99395843e8a321dc1990
Last active December 1, 2021 18:14
Picard.app renaming pattern
$rreplace($rreplace($rreplace($if2(%albumartist%,%artist%)-%album%$if(%catalognumber%,-\($upper($rreplace(%catalognumber%,[^A-Za-z0-9],))\))$if(%date%,-$left(%date%,4))/$lower($num(%tracknumber%,2)-%artist%-%title%),['\\.\,;:]+,),\\s+,_),Various_Artists,VA)
@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 / 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 / filter.rb
Last active November 18, 2015 16:14
module FiltrableModel
def filter_class=(klass)
@filter_class = klass
end
def filter(params = {})
@filter_class or raise "No filter model specified"
@filter_class.new(self).apply(params)
end
end