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
const url = window.location.href; | |
const GITHUB_REGEX = new RegExp("(?:http|https):\\/\\/github.com\\/([A-Za-z0-9-]+)\\/([A-Za-z0-9-_\\.]+)"); | |
const res = GITHUB_REGEX.exec(url); | |
if(!res) { | |
alert('Please first visit a repo on GitHub.\nFor example: github.com/airbnb/javascript'); | |
} else { | |
window.open(`https://relatedrepos.com/gh/${res[1]}/${res[2]}`, '_blank'); | |
} |
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
// Some inspiration from | |
// https://github.com/patiek/GoMusPlaylistExport/blob/master/exporter.js | |
(async function() { | |
async function delay(ms) { | |
return new Promise(resolve => setTimeout(resolve, ms)); | |
} | |
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
function nodeDebug() { | |
# https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27 | |
echo "Open chrome and type about:inspect" | |
echo "Open dedicated DevTools for Node" | |
node --inspect-brk $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
(async function() { | |
function loadScript(url) { | |
const script = document.createElement("script"); | |
script.src = url; | |
document.head.appendChild(script); | |
return new Promise(function(resolve, reject) { | |
script.onload = resolve; | |
}); | |
} |
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
exports.knex = require('knex')({ | |
client: 'pg', | |
connection: { | |
host : '127.0.0.1', | |
user : 'your_database_user', | |
password : 'your_database_password', | |
database : 'myapp_test' | |
} | |
}); |