Skip to content

Instantly share code, notes, and snippets.

View oliviernt's full-sized avatar
🚲
☕ & 🎵&🚴‍♂️

Olivier Tille oliviernt

🚲
☕ & 🎵&🚴‍♂️
View GitHub Profile
@oliviernt
oliviernt / nba-redirect-bookmarklet.js
Last active October 3, 2023 06:45
Bookmarklet to prevent NBA.com redirect to local nba site
// on https://nba.com/standings (or some path below the TLD where you normally don't get redirected)
// execute:
(() => {
const cookie = "gr=franceuw"; // you might need to change the cookie value if in another country
document.cookie = cookie;
const div = document.createElement("div");
div.textContent = `Cookie set: ${cookie}`;
div.style.background = "white";
div.style.border = "1px solid limegreen";
div.style["border-radius"] = ".8rem"
@oliviernt
oliviernt / broken-images.sw.js
Last active December 19, 2018 11:46 — forked from ireade/sw.js
Handle broken images with the service worker
let imgDataUri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAAEUCAMAAABUNq4iAAAC1lBMVEXm5uYAAAD/tgD/lgD/lwD/lgD/lwD/lwD/lgD/lgD/lgD/lwD/mAD/mwD/vwD/lgD/lwD/lgD/mQD/lwD/lwD/mgD/lwD/lwD/qgD/lwD//wD/lgD/nQD/lgD/lgD/lwD/lwD/lwD/lwD/lgD/lgD/lwD/lgD/lwD/lwD/lgD/lwD/qgD/lgD/lwD/mQD/qgD/lgD/nQD/mAD/lwD/mgD/lwD/ogD/oQD/lwD/lwD/mQD/lwD/lgD/mQD/mAD/lwD/lgD/mAD/lgD/mAD/lgD/lwD/lwD/lwD/lwD/pAD/lgD/lwD/lgD/lgD/lwD/lwD/mAD/lwD/lgD/mQD/lwD/lwD/mQD/mQD/nwD/lgD/lwD/lgD/mgD/lgD/lwD/lwD/lgD/nwD/ngD/lgD/lwD/lgD/lwD/lgD//wD/lgD/lgD/mAD/mQD/qgD/lgD/mwD/mAD/mgD/mQD/lwD/lgD/lwD/mQD/lwD/lwD/mAD/lgD/nAD/lwD/mwD/lwD/mAD/lgD/lgD/lgD/lwD/lwD/mQD/lgD/lwD/lwD/lwD/lwD/lgD/mQD/mAD/lwD/nAD/lgD/lwD/mAD/mwD/lwD/lwD/mAD/lgD/lwD/lgD/lgD/lwD/lwD/mgD/ngD/mAD/mQD/mAD/mQD/lwD/mAD/lgD/lwD/mAD/lwD/lwD/lwD/lgD/lwD/lwD/lwD/lwD/mgD/lgD/lgD/lwD/mAD/lwD/lwD/lgD/lwD/lgD/lwD/mAD/lwD/lgD/lwD/lwD/mAD/mAD/lwD/lwD/lgD/lwD/mAD/lgD/lgD/lgD/lgD/lgD/mAD/nwD/lwD/lwD/lwD/lwD/lwD/lgD/lwD/lwD/lwD/mwD/lwD/lwD/lgD/mAD/lwD/lgD/lgD/lgD/lwD/lgD/mAD/lwD/lwD/lwD/mAD/nAD/
@oliviernt
oliviernt / npmw
Last active September 6, 2018 07:51
NPM Wrapper allowing to use a specific Node + NPM version per project
#!/usr/bin/env bash
# Copyright 2018 Olivier Tille
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
@oliviernt
oliviernt / copy-json-to-clipboard.js
Last active January 11, 2018 07:39
Convert object to json and copy to clipboard in Chrome Developer Console
// Convert object to json and copy to clipboard in Chrome Developer Console
copy(JSON.stringify(o))

Keybase proof

I hereby claim:

  • I am oliviernt on github.
  • I am oliviernt (https://keybase.io/oliviernt) on keybase.
  • I have a public key whose fingerprint is 1166 15C5 AC96 EF40 38CB 8E2D 1D7B 6298 E76F 3F7E

To claim this, I am signing this object: