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
import os | |
files = os.listdir(os.curdir) | |
for file in files: | |
print(f'- {file}') |
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
# renew with dry run | |
certbot renew --dry-run | |
# get challenge | |
certbot -d domain.com --manual --preferred-challenges dns certonly | |
# install certificate | |
certbot --nginx -d domain.com |
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
// email validation | |
^([a-zA-Z0-9.+_-]+)@([a-z0-9.-]+)\.([a-zA-Z]{2,6}$) | |
// phone numbers | |
([0-9+\s]+)$ | |
// price, eg: 30, 12.45 | |
^([0-9]+)(\.[0-9]+)?$ |
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 |
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
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
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
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
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
// These are equals | |
class Test { | |
constructor(name) { | |
this.name = name; | |
} | |
getName() { | |
return this.name; | |
} |