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 case_number(number, line) { | |
return line.replace(/\[:(.*?)\]/g,function(a,g){return g==""?number:g.split(",")[(number%100>4&&number%100<20)?2:[2,0,1,1,1,2][(number%10<5)?number%10:5]];}); | |
} |
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 | |
# return "DEV-100" for branches like "feature/DEV-100-short-name" | |
ticket=$(git rev-parse --abbrev-ref HEAD | grep -o 'DEV-[0-9]*') | |
# current message | |
msg=$(cat $1) | |
# it not work for branches like "develop" | |
if [[ ! -z "$ticket" ]] && [[ "$msg" != "$ticket"* ]]; 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
#!/bin/bash | |
pid=$(ps ax | grep -v grep | grep /opt/sublime_text/sublime_text | tail -1 | awk '/[0-9]+/ {print $1}') | |
if [ -z "$pid" ]; then | |
subl | |
exit | |
fi | |
wmctrl -a "Sublime text" |
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 mouse params | |
POINTER_NAME="USB Optical Mouse" | |
POINTER_ID=$(xinput list --id-only $POINTER_NAME) | |
xinput set-prop $POINTER_ID 262 1.6 |
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
mogrify -background transparent -verbose -format png plus.svg |
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
-novid -high -threads 4 -full -w 2560 -h 1440 -noforcemaccel -noforcemparms -noforcemspd -nod3d9ex1 +cl_forcepreload 1 |
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 | |
DB_HOST=$1 | |
DB_PORT=$2 | |
DB_USER=$3 | |
DB_PASS=$4 | |
DB_NAME=$5 | |
DUMP_DIR=$6 | |
DUMP_TRAIN=$7 | |
DUMP_PREFIX=$8 |
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
var NEWLINE = "\n", | |
TAB = " "; | |
function eachWithIdx(iterable, f) { var i = iterable.iterator(); var idx = 0; while (i.hasNext()) f(i.next(), idx++); } | |
function output() { for (var i = 0; i < arguments.length; i++) { OUT.append(arguments[i]); } } | |
output( | |
"<?php", NEWLINE, NEWLINE, | |
"return [", | |
NEWLINE); |
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 | |
pid=$(pidof "${@}") | |
if [ -z "${pid}" ]; then | |
echo "process was not found. exit" | |
exit | |
fi | |
echo "${@} (pid ${pid})" |
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 | |
command_timeout=$1 | |
command_line=$2 | |
command_next=$3 | |
timeout="${command_timeout}" | |
logname="/tmp/run.$(date +%Y%m%d%H%M%S).log" | |
function hasNext { |
OlderNewer