#!/usr/bin/env bash
#
# usage:
# # just place it to the git repository hooks dir, named as "commit-msg"
# # with execution permission (+x)
# $ cp commit-msg <repo_path>/.git/hooks/
# $ chmod +x <repo_path>/.git.hooks/commit-msg
#
pattern="^((\[SB)-[0-9]{4}\]|(\[(HOTFIX|Hotfix|hotfix)\]))\s\w+"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DBNAME=<database_name> | |
| DBUSER=<database_user> | |
| DBHOST=<host> | |
| DUMP_FILE=$1 | |
| if [[ $DUMP_FILE == "" ]]; then | |
| echo "[ERROR] Arquivo de dump não especificado" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| GEMSET_NAME=seccomp | |
| RAILS_VERSION=4.2.3 | |
| RUBY_VERSION=2.2.3 | |
| while [ $# -gt 0 ]; do | |
| case "$1" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <%= form_for(@product) do |f| %> | |
| <% if @product.errors.any? %> | |
| <div id="error_explanation"> | |
| <h2><%= pluralize(@product.errors.count, "error") %> prohibited this product from being saved:</h2> | |
| <ul> | |
| <% @product.errors.full_messages.each do |message| %> | |
| <li><%= message %></li> | |
| <% end %> | |
| </ul> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| LOCAL_PORT=8080 | |
| REMOTE_SERVER=destination.server | |
| REMOTE_USER=user | |
| ssh -D $LOCAL_PORT -f -C -q -N $REMOTE_USER@$REMOTE_SERVER |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # trigger event | |
| def trigger_event(jquery_element, event) | |
| page.execute_script("$('#{jquery_element}').trigger('#{event}')") | |
| end | |
| # write html page to file | |
| File.write('output.html', page.html) |
Reverting batch commits
git checkout -b <new_branch> <ref_branch>
git reset <previous_commit_hash>
git add -p
git clean -f
git reset --hard
Amending commit with open Pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'find' | |
| dir = ARGV[0] | |
| input = File.open(ARGV[1]).read | |
| # output = File.new((ARGV[2] || 'output'), 'w+') | |
| # puts "searching for #{input.lines.count} files starting at #{dir}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set nocompatible " be iMproved, required | |
| filetype off " required | |
| " set the runtime path to include Vundle and initialize | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
| " alternatively, pass a path where Vundle should install plugins | |
| "call vundle#begin('~/some/path/here') | |
| " let Vundle manage Vundle, required | |
| Plugin 'VundleVim/Vundle.vim' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http_proxy: <proxy:port> |