- Go to https://dumps.wikimedia.org/backup-index.html
- Go to language and download
-pages-meta-current.xml.bz2
version - Extract
- Flatten with
pv file.xml | xml2 > file.flat
- Exrtract text with
pv file.flat| grep -oP "(?<=^/mediawiki/page/revision/text=).*" > file.txt
- Clean with
pv fawiki-20200220-pages-articles.txt | node clean.js
- Enjoy using
out.txt
Tiny (230 char) Polyfill for window.doNotTrack
. Checks for:
window.doNotTrack == 1
navigator.doNotTrack == 'yes'
navigator.doNotTrack == 1
navigator.msDoNotTrack == 1'
window.external.msTrackingProtectionEnabled()
And sets value to either 1
(do not track) or 0
(track)
This file contains 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 gitCommit = process.env.GIT_COMMIT || require('child_process') | |
.spawnSync('git', ['rev-parse', '--short', 'HEAD'], { encoding: 'utf8' }) | |
.stdout.slice(0, -1) | |
console.log(gitCommit) |
This file contains 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
{ | |
// Editor | |
"diffEditor.renderSideBySide": true, | |
"editor.fontFamily": "Anonymous, InputMono, Menlo, Monaco, 'Courier New', monospace", | |
"editor.find.autoFindInSelection": true, | |
"editor.fontLigatures": true, | |
"editor.formatOnSave": false, | |
"editor.formatOnType": true, | |
"editor.formatOnPaste": true, |
This file contains 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 substractIdArrays(a, b) { | |
return a.filter(x => !b.find(y => y + '' === x + '')) | |
} | |
async function updateArea(areaCode) { | |
const area = await Area.findOne({ areaCode }) | |
const associatedHotels = await Hotel.find({ areaCode }).then(hotels => hotels.map(h => h._id)) | |
const hotelsInArea = await Hotel.find({ |
This file contains 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
for d in `find -name node_modules -type d` ; do [ -d "$d" ] && echo "$d" && rm -rf "$d" ; done |
This file contains 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 Agent = require('agentkeepalive') | |
require('http').globalAgent = new Agent() | |
require('https').globalAgent = new Agent.HttpsAgent() |
This file contains 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
{ | |
// Editor | |
"diffEditor.renderSideBySide": true, | |
"editor.fontFamily": "Anonymous, InputMono, Menlo, Monaco, 'Courier New', monospace", | |
"editor.find.autoFindInSelection": true, | |
"editor.fontLigatures": true, | |
"editor.formatOnSave": false, | |
"editor.formatOnType": true, | |
"editor.formatOnPaste": true, |
This file contains 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
# Deps | |
sed -i "s|# deb-src|deb-src|" /etc/apt/sources.list | |
apt update | |
export DEPS=" \ | |
build-essential zlib1g-dev libpcre3-dev unzip uuid-dev \ | |
debhelper po-debconf libexpat-dev libgd-dev libgeoip-dev libhiredis-dev \ | |
libluajit-5.1-dev libmhash-dev libpam0g-dev libperl-dev libssl-dev libxslt1-dev quilt" | |
apt install -y $DEPS | |
# NXG Pagespeed |
This file contains 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
ssh -vo ProxyCommand='ssh -W %h:%p root@proxy_host' root@dst_host |