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 / 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)
$(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 / 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
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 / 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"
}
@knoopx
knoopx / I18n.exception_handler = SimpleExceptionHandler
Created November 13, 2013 12:23
I18n.exception_handler = SimpleExceptionHandler
class SimpleExceptionHandler < I18n::ExceptionHandler
def self.call(exception, locale, key, options)
if exception.is_a?(I18n::MissingTranslation)
exception.keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1.capitalize }
else
super
end
end
end
@knoopx
knoopx / README.md
Last active December 19, 2015 22:58
Send github pull requests from the command line
@knoopx
knoopx / sshd_config
Last active December 15, 2015 17:09
# This prevents capistrano from hanging when executing long tasks
# /etc/ssh/sshd_config
TCPKeepAlive yes
ClientAliveInterval 15
ClientAliveCountMax 5
# Restart sshd
* Get rid of default gems: turbolinks, uglifier
* Replace require 'rails/all' with specific railties
* Add lib to autoload path: `config.autoload_paths += %W(#{config.root}/lib)`
* Replace default railties
* Add some other gems
@knoopx
knoopx / knoopx.zsh-theme
Created March 25, 2013 18:23
My oh-my-zsh theme
PROMPT='%{$fg[grey]%}%n@%m %{$fg[green]%}%~%{$reset_color%}$(__git_ps1) %{$fg[green]%}$%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="("
ZSH_THEME_GIT_PROMPT_SUFFIX=") "