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 bash | |
| COMMIT_EDITMSG=$1 | |
| BRANCH_REF=$(git rev-parse --abbrev-ref HEAD) | |
| COMMIT_REGEX='\[[A-Z]{2,}-[0-9]{1,6}\]' # regex to validate in commit msg | |
| ERROR_MSG="Aborting commit. Your commit message is missing a valid Jira Issue descriptor of the form /$COMMIT_REGEX/ (e.g. [ECHO-616])." | |
| if [ "$BRANCH_REF" = "master" ] || [ "$BRANCH_REF" = "dev" ] | |
| then | |
| exit |
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 bash | |
| COMMIT_EDITMSG=$1 | |
| TYPE=$2 # one of message, template, merge, squash, commit | |
| REF=$3 # optional, when TYPE is commit | |
| COMMIT_REGEX='([A-Z]{2,}-[0-9]{1,6})' | |
| BRANCH_REF=$(git rev-parse --abbrev-ref HEAD) | |
| if [ "$BRANCH_REF" = "master" ] || [ "$BRANCH_REF" = "dev" ]; then |
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
| { | |
| "name": "static", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1", | |
| "build.js.dev": "webpack --mode development -o static/main.js", | |
| "build.js.prod": "webpack --mode production -o static/main.js", | |
| "clean": "rm -rf static/", |
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
| git clone --bare [email protected]:user/repo.git | |
| cd repo.git | |
| ``` | |
| #!/bin/sh | |
| git filter-branch --env-filter ' | |
| OLD_EMAIL="[email protected]" | |
| CORRECT_NAME="Your Correct Name" | |
| CORRECT_EMAIL="[email protected]" |
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 | |
| CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| echo -e "\nCreate a PR at:" | |
| echo "https://github.com/<org>/<repo>/compare/dev...$CURRENT_BRANCH?expand=1" | |
| echo -e "\n" |
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
| function checkMd5 { | |
| md5 $1 | sed -e 's/^MD5 (\(.*\)) = \(.*\)/\2 \1/' | diff $2 - | |
| } |
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
| ## Custom Functions | |
| function pgc | |
| { | |
| pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log $1 | |
| } | |
| function dit { |
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
| # centos 6 | |
| sudo yum install zsh -y | |
| # load 'zim' from https://github.com/Eriner/zim | |
| git clone --recursive https://github.com/Eriner/zim.git ${ZDOTDIR:-${HOME}}/.zim | |
| setopt EXTENDED_GLOB | |
| for template_file ( ${ZDOTDIR:-${HOME}}/.zim/templates/* ); do | |
| user_file="${ZDOTDIR:-${HOME}}/.${template_file:t}" |
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/ruby | |
| # Simple script to help with modularizing js files. | |
| # This script find lines in a file w/ functions from a commmon.js library file | |
| def get_funcs(file,libraryfile) | |
| funcs = open(libraryfile) do |f| | |
| content = f.read | |
| content.scan(/exports\.(.*)=\s?function/) |
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
| # type in js code to execute | |
| js_str = gets.chomp | |
| c = js_str.split('').map { |char| char.ord } | |
| js_code = "var c=#{c.to_s};var code='';for(var i=0;i<c.length;i++){code=code+String.fromCharCode(c[i]);}eval(code);" | |
| puts "<script>#{js_code}</script>" |
NewerOlder