Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name Analytics PingPong
// @namespace d0whc3r
// @version 0.0.3
// @description Show ping-pong analytics
// @author d0whc3r
// @match https://www.flashscore.com/table-tennis/*
// @match https://www.flashscore.com/match/*
// @icon https://www.google.com/s2/favicons?domain=flashscore.com
// @grant none
@d0whc3r
d0whc3r / README.md
Last active September 28, 2021 10:08
Cornix extract results

Instructions

Requirements

Execution

  • Run node extract.js

PD: You can add --dot as parameter (node extract.js --dot) to use "." as decimal separator, if not, "," (comma) will be used

const https = require('https');
/**
* Make a https request
* @param {string} url
* @param {import('https').RequestOptions} options
* @param {Record<string, any>} [postData]
* @returns {Promise<{ data: Record<string, any>, statusCode: number, statusMessage: string }>}
*/
function request(url, options, postData) {
@d0whc3r
d0whc3r / rancher-backup.sh
Created May 21, 2019 11:36 — forked from Panthro/rancher-backup.sh
Rancher2 backup on Google Drive
#!/bin/bash
#RANCHER_SERVER_NAME=$(docker ps -a --format "{{.Image}} {{.Names}}" | grep -i "rancher/rancher" | cut -d' ' -f2)
RANCHER_SERVER_NAME=rancher-server
TODAY_DATE=$(date +%Y%m%d)
RANCHER_COPY_NAME=rancher-data-${TODAY_DATE}
CREDENTIALS_PATH=~/secrets
BACKUP_PATH=~/backup
RANCHER_BACKUP_FILE_BASE=rancher-data-backup
RANCHER_BACKUP_FILE=${RANCHER_BACKUP_FILE_BASE}-${TODAY_DATE}.tar.gz
USE_GDRIVE=0
@d0whc3r
d0whc3r / rancher-backup.sh
Created March 24, 2019 12:36
Rancher 2 backup script
#!/bin/bash
RANCHER_SERVER_NAME=$(docker ps -a --format "{{.Image}} {{.Names}}" | grep -i "rancher/rancher" | cut -d' ' -f2)
TODAY_DATE=$(date +%Y%m%d)
RANCHER_COPY_NAME=rancher-data-${TODAY_DATE}
CREDENTIALS_PATH=~/secrets
BACKUP_PATH=~/backup
RANCHER_BACKUP_FILE=rancher-data-backup-${TODAY_DATE}.tar.gz
USE_GDRIVE=0
if [ "$1" = "--gdrive" ]; then
@d0whc3r
d0whc3r / randomstring.js
Created May 6, 2018 22:28
Simple random string
function randString(length = 10) {
// const text = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
// const nums = '0123456789';
// const vals = `${text}${text.toLowerCase()}${nums}`;
const vals = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
return Array(length).fill().map(() => vals.charAt(Math.floor(Math.random() * vals.length))).join('');
}
@d0whc3r
d0whc3r / mkdir_p.js
Created May 6, 2018 10:41
simple recursive mkdir
const path = require('path');
const fs = require('fs');
function mkdirp(targetDir) {
const sep = path.sep;
const initDir = path.isAbsolute(targetDir) ? sep : '';
targetDir.split(sep).reduce((parentDir, childDir) => {
const curDir = path.resolve(parentDir, childDir);
if (!fs.existsSync(curDir)) {
fs.mkdirSync(curDir);
@d0whc3r
d0whc3r / enable_internet.md
Last active April 19, 2018 23:12
Centos docker to external internet

Firewall in centOS for docker to connect internet

moby/moby#16137 (comment)

nmcli connection modify docker0 connection.zone trusted
systemctl stop NetworkManager.service
firewall-cmd --permanent --zone=trusted --change-interface=docker0
systemctl start NetworkManager.service
nmcli connection modify docker0 connection.zone trusted
@d0whc3r
d0whc3r / DI.m3u
Created April 1, 2018 07:58 — forked from sim642/DI.m3u
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
@d0whc3r
d0whc3r / Gruntfile.js
Created July 12, 2016 19:24
grunt-injector include sass files to main.scss
// file:Gruntfile.js
module.exports = function(grunt) {
// Time how long tasks take. Can help when optimizing build times
require('time-grunt')(grunt);
// Automatically load required Grunt tasks
require('jit-grunt')(grunt, {
// [...]
injector: 'grunt-injector'