This file contains 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
alias grep='grep -i --color' | |
export GREP_COLOR='40;01;31' | |
function parse_git_dirty { | |
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null \ | |
| sed -e '/^[^*]/d' -e "s/* \(.*\)/\1 /" | |
#| sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/" |
This file contains 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
<?php | |
$initialData = file_get_contents("./old.ser"); | |
$data = preg_replace('!s:(\d+):"(.*?)";!e', "'s:'.strlen('$2').':\"$2\";'", $initialData); | |
$fp = fopen ("./new.ser", "w"); | |
fwrite($fp, $data); | |
fclose($fp); |
This file contains 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 | |
while [[ $# > 1 ]] | |
do | |
key="$1" | |
case $key in | |
-i|--initial) | |
INITIAL_COMMIT="$2" | |
shift # past argument |
This file contains 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 | |
# es-maintenance-script.sh | |
# Notes: | |
# - https://www.elastic.co/guide/en/elasticsearch/guide/current/retiring-data.html | |
# - http://tech.superhappykittymeow.com/?p=296 | |
# | |
# Author: Gabriel C <shellcooking@gmail.com> | |
# Display instructions | |
help() |
This file contains 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 | |
# git-mv-with-history -- move/rename file or folder, with history. | |
# https://git.wiki.kernel.org/index.php/GitFaq#Why_does_Git_not_.22track.22_renames.3F | |
function usage() { | |
echo "How to use it: `basename $0` [-d/--dry-run] [-v/--verbose] <srcname>=<destname> <...> <...>" | |
[ -z "$1" ] || echo $1 | |
exit 1 | |
} |
This file contains 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
<?php | |
/** | |
composer.json | |
{ | |
"name": "predis-copy-keys", | |
"require": { | |
"predis/predis": "^1.1" | |
}, | |
"authors": [ |
This file contains 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 | |
SLACK_HOOK_URL="https://hooks.slack.com/services/SOME/SPECIAL/TOKEN" | |
SLACK_CHANNEL="#production-logs" | |
tail -n0 -F "$1" | while read LINE; do | |
(echo "$LINE") && curl -X POST --silent --data-urlencode \ | |
"payload={\"channel\": \"$SLACK_CHANNEL\", \"mrkdwn\": true, \"text\": \"$(echo $LINE | sed "s/\"/'/g") | File: ${1} | Server: $(hostname)\"}" $SLACK_HOOK_URL; | |
done |
This file contains 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
/** | |
* Copyright (c) 2015-present, Facebook, Inc. | |
* | |
* This source code is licensed under the MIT license found in the | |
* LICENSE file in the root directory of this source tree. | |
*/ | |
package com.facebook.react.uimanager; | |
import static android.view.View.MeasureSpec.AT_MOST; | |
import static android.view.View.MeasureSpec.EXACTLY; |
This file contains 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
# ~/.bashrc | |
eval "$(starship init bash)" |
This file contains 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
call plug#begin('~/.config/nvim/.plugged') | |
" operators | |
Plug 'tpope/vim-surround' | |
Plug 'christoomey/vim-sort-motion' | |
" textobj | |
Plug 'wellle/targets.vim' | |
" workflow |
OlderNewer