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
# This configuration file is intended for local use of SonarScanner. | |
sonar.organization=mycompany | |
sonar.projectKey=myproject | |
# relative paths to source directories. More details and properties are described | |
# in https://docs.sonarqube.org/latest/project-administration/narrowing-the-focus/ | |
sonar.sources=. | |
sonar.sourceEncoding=UTF-8 | |
sonar.inclusions=app/**/*.* |
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
// (from https://dev.to/busypeoples/notes-on-typescript-recursive-types-and-immutability-5ck1) | |
// Makes a deeply immutable version of Type, using recursion. | |
type MakeReadOnly<Type> = { | |
readonly [Key in keyof Type]: MakeReadOnly<Type[Key]>; | |
}; | |
// Usage / Examples | |
const shape = { |
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
$ echo '{"a":1}' \ | |
| node -e \ | |
"d=[];process.openStdin().on('data',c=>d.push(c)).on('end',()=>console.log(JSON.stringify(JSON.parse(d.join('')),null,2)));" | |
# => | |
# { | |
# "a": 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 | |
set -e | |
BITWARDEN_ENTRY_ID="TODO" # à remplir depuis `$ bw list items --search name_of_my_entry` | |
echo "🔒 getting ssh password from bitwarden" | |
bw get password ${BITWARDEN_ENTRY_ID} | pbcopy | |
echo "🔑 ssh password can be pasted for 10 seconds, from now" | |
(sleep 10; echo "🧹 clearing password"; echo -n '' | pbcopy)& |
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 | |
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 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
allHits=[]; | |
algoliaClient | |
.initIndex(indexName) | |
.browseAll() | |
.on('result', ({hits}) => allHits.push(...hits)) | |
.on('end', () => console.log(allHits)); |
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 --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 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
// 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 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 | |
# 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 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
# 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") \ |