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
#!/usr/bin/env bash | |
REPO_URL="https://gitlab.com/xxx/node_app-web.git" | |
PORT=3000 | |
echo "Generate Dockerfile from ${REPO_URL}..." | |
cat > Dockerfile << CONTENTS | |
FROM node:10 | |
WORKDIR /usr/src/app | |
RUN git clone ${REPO_URL} . |
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
allHits=[]; | |
algoliaClient | |
.initIndex(indexName) | |
.browseAll() | |
.on('result', ({hits}) => allHits.push(...hits)) | |
.on('end', () => console.log(allHits)); |
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
git log --pretty=format:"@%ad ~~%s~~" --date=short --shortstat \ | |
| tr "\n" " " \ | |
| tr "@" "\n" \ | |
| grep -v 'skip ci' \ | |
| grep -v 'deps' \ | |
| grep -v 'dependencies' \ | |
| sed -En 's/ ~~.*~~ /,/p' |
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
// copy and paste that script in the js console, from a facebook "note" url | |
permalink = $$('.mts a')[0]; | |
[_, monthName, day, year] = new Date(permalink.innerText.split(' at ')[0]).toString().split(' '); | |
monthNum = { | |
Jan: 0, | |
Feb: 1, | |
Mar: 2, | |
Apr: 3, | |
May: 4, |
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
#!/usr/bin/env bash | |
# USAGE: ./generate-html-with-colors-from-jest-test-results.sh <file_name> | |
# => will create: | |
# - <file_name>.log (with color codes) | |
# - <file_name>-plain.log (without color codes) | |
# - <file_name>.html | |
FILENAME=$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
# List local branches that were squashed and merged to master | |
$ comm -1 -2 \ | |
<(git remote prune origin --dry-run | sed "s/^.*origin\///g") \ | |
<(git branch | sed "s/^..//") \ | |
| sed "/^$/d" | |
# List local branches that were squashed and merged to master | |
# ... then give you the opportunity to edit them before deleting them. | |
$ comm -1 -2 \ | |
<(git remote prune origin --dry-run | sed "s/^.*origin\///g") \ |
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
#!/usr/bin/env bash | |
# First, download "Location History" from https://takeout.google.com/settings/takeout?hl=en&gl=EN&expflags | |
# (fr: "Historique des positions" from https://takeout.google.com/settings/takeout?hl=fr&gl=FR&expflags) | |
# | |
# => Big "Location history.json" file that looks like that: | |
# | |
# { | |
# "locations": [ | |
# { "timestampMs": "1546415889121" }, |
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
#!/usr/bin/env bash | |
# USAGE: ./run-from-git.sh https://gitlab.com/danylo.zhalkovskyy/node_app-web.git | |
REPO_URL="${1}" # e.g. "https://gitlab.com/danylo.zhalkovskyy/node_app-web.git" | |
PORT=3000 | |
echo "Generate Dockerfile from ${REPO_URL}..." | |
cat > Dockerfile << CONTENTS | |
FROM node:10 |
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
#!/usr/bin/env bash | |
echo "CSV file: $1" | |
NB_CODES=20 | |
URL_PREFIX="https://harissa.bandcamp.com/yum?code=" | |
npm install qrcode | |
mkdir -p qrcodes |
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
#!/usr/bin/env bash | |
# inspiration: https://davidwalsh.name/pull-down-pr | |
# The `git pr` alias will checkout the branch associated to a given PR. | |
# Usage: `$ git pr 204` | |
git config --global --add alias.pr '!f() { git fetch -fu ${2:-origin} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f' | |
# The `git pr-clean` alias will delete all the `pr/*` branches kept locally. | |
# Usage: `$ git pr-clean` |