Skip to content

Instantly share code, notes, and snippets.

View FlorianWendelborn's full-sized avatar
🇺🇦

Florian Wendelborn FlorianWendelborn

🇺🇦
View GitHub Profile

Monorepo Merge

Assuming you have two git repositories monorepo, and my-project and want to add my-project to monorepo/projects/my-project:

cd my-project
git filter-branch --index-filter '
    git ls-files -s |
    sed "s,     ,&'"projects/my-project/"'," |
 GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info &&
@FlorianWendelborn
FlorianWendelborn / retag.sh
Last active October 9, 2018 23:18
Adds a prefix/suffix to all existing git tags.
#!/usr/bin/env bash
PREFIX="versions/my-app/"
SUFFIX=""
git tag -l | while read t; do
NEW_NAME="${PREFIX}${t}${SUFFIX}"
git tag $NEW_NAME $t
git tag -d $t
done
const appointments = [[100, 125], [200, 230], [230, 400]]
const requests = [[10, 50], [130, 210], [240, 250]]
const times = [[0]]
for (let i = 0; i < appointments.length; i++) {
const [ra, rb] = appointments[i]
const last = times[times.length - 1]
last[1] = ra
someArray.sort(({ [key]: a }, { [key]: b }) => ((ascending ? a < b : a > b) ? 1 : -1))
const WIDTH = 32
const fs = require('fs')
const chalk = require('chalk')
const hsl2rgb = require('pure-color/convert/hsl2rgb')
// const e = require('emoji.json')
const file = fs.readFileSync(process.argv[2])
file.forEach((char, index) => {
const rgb = hsl2rgb([char / 256 * 360, 100, 50]).map(i => Math.floor(i))
#!/bin/bash
set -e
rm -f text
vi text
rm -f text.asc
gpg --clearsign text
cat text.asc | sed -e 's/^/ /' | pbcopy
#!/bin/bash
set -e
rm -f text
vi text
rm -f text.asc
gpg --clearsign text
cat text.asc | pbcopy
const add=(x,...r)=>x+(+r?r[0]:add(...r));
console.log(add(1,2,3,4,5,6));

Keybase proof

I hereby claim:

  • I am dodekeract on github.
  • I am dodekeract (https://keybase.io/dodekeract) on keybase.
  • I have a public key whose fingerprint is A1E4 7ADC D550 DAE9 2337 7CF2 647E 95F1 6C71 B29F

To claim this, I am signing this object: