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 log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20 | |
| git shortlog -sn --no-merges | |
| git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c |
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
| // go to https://twitter.com/settings/your_twitter_data/twitter_interests | |
| var timer=1000; document.querySelectorAll( "div > input[type='checkbox']:checked" ).forEach((interest) => { setTimeout( function(){interest.click(); interest.scrollIntoView()},timer ); timer+=2000; }); |
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
| import boto3 | |
| session = boto3.Session() | |
| s3 = session.resource(service_name='s3') | |
| bucket = s3.Bucket('bucket-name') | |
| bucket.object_versions.delete() |
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 | |
| cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 | |
| trap cleanup SIGINT SIGTERM ERR EXIT | |
| usage() { | |
| cat <<EOF | |
| Usage: $(basename "$0") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
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 log --shortstat --pretty=tformat: --numstat --since="1 Jul, 2018" | grep -E "fil(e|es) changed" | awk '{files+=$1; inserted+=$4; deleted+=$6; delta+=$4-$6; ratio=deleted/inserted} END {printf "Commit stats:\n- Files changed (total).. %s\n- Lines added (total).... %s\n- Lines deleted (total).. %s\n- Total lines (delta).... %s\n- Add./Del. ratio (1:n).. 1 : %s\n", files, inserted, deleted, delta, ratio }' - |
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
| find . -name '*.php' -print0 | xargs -0 sed -i "" 's/{Number}/{Integer}/g' |
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
| // NodeList to Array: | |
| var headings = [ ... document.querySelectorAll('h1') ]; | |
| // Unique Arrays: | |
| [ ...new Set(array) ] | |
| // Destructuring: | |
| var {foo, bar} = {foo: "lorem", bar: "ipsum"}; | |
| // foo => lorem and bar => ipsum |
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 getValue(char) { | |
| numerals = { | |
| 'i': 1, | |
| 'v': 5, | |
| 'x':10, | |
| 'l':50, | |
| 'c':100, | |
| 'd':500, | |
| 'm':1000 | |
| } |
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
| # Single line comments start with a number symbol. | |
| """ Multiline strings can be written | |
| using three "s, and are often used | |
| as comments | |
| """ | |
| #################################################### |
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
| # create | |
| pg_dump -U {user} {database_name} > ~/file.dump | |
| #restore | |
| psql {database_name} < ~/file.dump |
NewerOlder