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 | |
# @source: https://medium.com/@Drew_Stokes/bash-argument-parsing-54f3b81a6a8f | |
PARAMS="" | |
while (( "$#" )); do | |
case "$1" in | |
-a|--my-boolean-flag) | |
MY_FLAG=0 | |
shift |
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 | |
COMPOSER_MEMORY_LIMIT=-1 composer require --dev barryvdh/laravel-ide-helper | |
php artisan ide-helper:generate | |
php artisan ide-helper:meta | |
COMPOSER_MEMORY_LIMIT=-1 composer remove barryvdh/laravel-ide-helper |
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 python2 | |
from os import environ | |
import datetime | |
import socket | |
import ssl | |
import logging | |
from urllib2 import Request, urlopen, URLError, HTTPError | |
import json |
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 | |
podId=$(kubectl get pod -o name | \ | |
grep --color=never -o -E \ | |
"\/.*$(echo $@ | tr '_ ' '.').*" \ | |
) | |
podId=$(echo $podId | sed 's/ .*//g' | tr -d '/') | |
echo Showing logs from $podId | |
kubectl logs $podId --tail=20 -f |
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 collections = db.getCollectionNames(); | |
collections.forEach(function (item) { | |
print(item + ": " + db[item].stats().count); | |
}); |
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 | |
ag -l 'strict_types = 1' src tests | xargs -I{} sed -i "" 's/strict_types = 1/strict_types=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 | |
docker exec -it $(basename `pwd`) $@ |
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 | |
# head -n200 /dev/urandom | cksum :: get output from urand and 'convert' it to dec; not exactly perfect | |
# sed :: remove anything that's NaN (e.g. spaces) | |
# head :: make the generated rand number 10 digits long | |
head -n200 /dev/urandom | cksum | sed -E 's/[^0-9]+//' | head -c 10 |
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 @i = 1; | |
update table | |
set field = @i := @i + 1 | |
where field2 = 11; |
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 | |
ag -l '$1' | xargs -I{} sed -ibak 's/$1/$2/' {} |
NewerOlder