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
code --list-extensions | xargs -L 1 echo code --install-extension |
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 text = ` | |
<p>This is some test with <a href=\"/piesync.html\">a relative link</a> and one with an <a href=\"http://piesync.com\">absolute link</a></p> | |
<p>This is some test with <a href=\"/piesync.html\" title="test">a relative link</a> and one with an <a href=\"http://www.piesync.com\">absolute link</a></p> | |
<p>This is some test with <a href=\"/piesync/hello/path\">a relative link</a> and one with an <a href=\"http://piesync.com\">absolute link</a></p> | |
<p>This is some test with <a href=\"/\">a relative link</a> and one with an <a href=\"http://piesync.com\">absolute link</a></p> | |
<p>This is some test with <a href=\"/?_ga=2.12323232.131232131.423413123-1231231.123123123\">a relative link</a> and one with an <a href=\"http://piesync.com\">absolute link</a></p> | |
`; | |
let replaced = text.replace(/<a href="(\/([\w.\/?=-]+)|\/)/gm, `<a href="https://www.domain.com$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
// These are equals | |
class Test { | |
constructor(name) { | |
this.name = name; | |
} | |
getName() { | |
return this.name; | |
} |
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
jest.mock('react-chartjs-2', () => ({ | |
Pie: () => null, | |
})); |
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
python -m http.server 8000 |
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 branch | grep "<pattern>" | xargs git branch -D |
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
db.getCollection('competitions').aggregate([ | |
{ | |
$unwind: '$matches' | |
}, | |
{ | |
$sort: { 'matches.date': -1 } | |
}, | |
{ | |
$limit: 3 | |
} |
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 will filter down to the matches with a specific player, with the matches being played after a specific date, | |
* and it will show only the aggregate matches after that date ignoring the previous ones | |
*/ | |
var dateFilter = new ISODate("2019-06-01T20:15:31Z"); | |
db.getCollection('competitions').aggregate([ | |
{ | |
$match: { | |
players: ObjectId("5c71c4c1185c610046f17911"), |
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
docker exec -it -u root jenkins /bin/bash |