Skip to content

Instantly share code, notes, and snippets.

View rmehner's full-sized avatar
🤷‍♀️
¯\_(ツ)_/¯

Robin Mehner rmehner

🤷‍♀️
¯\_(ツ)_/¯
View GitHub Profile
/**
* @flow
*/
'use strict';
/*
* Flow types for the Babylon AST.
*/
@rmehner
rmehner / dexie-unique-compound-indizes.js
Last active March 3, 2020 18:46
Using unique compound indizes with Dexie.js
const db = new Dexie('friends')
db.version(1).stores({
friends: '++id,&[name+age]',
})
async function main() {
await db.friends.add({ name: 'Robin', age: 1337 })
// this will fail with:
// ConstraintError: A mutation operation in the transaction failed because a constraint was not satisfied.
await db.friends.add({ name: 'Robin', age: 1337 })
diff --git "a/test/fixture/r\303\266ck/d\303\266ts" "b/test/fixture/r\303\266ck/d\303\266ts"
new file mode 100644
index 0000000..e69de29
diff --git a/test/index.js b/test/index.js
index 22efd0d..fd749ee 100644
--- a/test/index.js
+++ b/test/index.js
@@ -27,11 +27,16 @@ function testSpecialChars() {
assert.equal(trueCasePathSync('test/fixture/F[U&N%K)Y'), path.join(__dirname, 'fixture/f[u&n%k)y'), 'works with file names w/ special chars')
}
@rmehner
rmehner / remove-android-sdk.sh
Last active March 1, 2017 19:01
Remove everything related to Android for a clean start (OHAI cordova)
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm -Rf ~/Library/Preferences/com.google.android.*
rm -Rf ~/Library/Preferences/com.android.*
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*
rm -Rf ~/Library/Caches/AndroidStudio*
rm -Rf ~/.AndroidStudio*
rm -Rf ~/AndroidStudioProjects
rm -Rf ~/.gradle
#!/usr/bin/env bash
set -e
info() { echo "$0: $1"; }
skip() { info "${1}. Skipping build."; exit 0; }
[[ "$TRAVIS_PULL_REQUEST" == "false" ]] || {
skip "This build was triggered by a pull request"
}
@rmehner
rmehner / install_pdftk.sh
Last active May 6, 2021 03:54
Install PDFTk without touching up the permissions
#!/usr/bin/env bash
# This is based on this excellent gist https://gist.github.com/jvenator/9672772a631c117da151
# Nothing of this is my original work, except that I made the download link an argument
# to this script, so it installs on OSX 10.11
#
# Thank you jvenator & sethetter
set -e
error() { info "$1"; exit 1; }
sudo chown $(whoami):admin /usr/local && sudo chown -R $(whoami):admin /usr/local
@rmehner
rmehner / adb_screenshot.sh
Created April 7, 2015 13:57
Screenshot from ADB
# thank you http://blog.shvetsov.com/2013/02/grab-android-screenshot-to-computer-via.html
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screen.png
@rmehner
rmehner / CoC.md
Created April 1, 2015 10:59
CoC on Tito

Code of Conduct

Be excellent to each other!

Our goal is to have an awesome and inclusive community-driven conference where people meet, hang out together, chat, listen to talks, exchange ideas and make new friends. Any harmful or discriminating behaviour will not be tolerated and results in the offending person being expelled from the conference.

Our complete Code of Conduct helps us to make sure that we are as inclusive and safe as we want everyone to be.

We care about you. If anything happens, please contact us.

@rmehner
rmehner / delete-databases.js
Last active April 4, 2024 09:18
Delete all indexedDB databases
// Credit to @steobrien from https://gist.github.com/rmehner/b9a41d9f659c9b1c3340#gistcomment-2940034
// for modern browsers, this works:
const dbs = await window.indexedDB.databases()
dbs.forEach(db => { window.indexedDB.deleteDatabase(db.name) })
// for older browsers, have a look at previous revisions of this gist.