Skip to content

Instantly share code, notes, and snippets.

View deepl-scraper.log
ℹ Starting test suite 19:17:49
ℹ Testing supported languages 19:17:49
✔ Source languages are valid 19:17:50
✔ Target languages are valid 19:17:50
ℹ Downloading pangrams
View deepl-scraper.log
ℹ Starting test suite 10:39:22
ℹ Testing supported languages 10:39:22
✔ Source languages are valid 10:39:22
✔ Target languages are valid 10:39:22
ℹ Downloading pangrams 10:39:22
ℹ Testing translations 10:39:23
ℹ Testing translations from en 10:39:23
ℹ Testing translation from en to de-DE 10:39:23
✔ Translation : Erstaunlich wenige Diskotheken bieten Jukeboxen an.
View deepl-scraper.log
i Starting test suite 00:22:56
i Testing supported languages 00:22:56
√ Source languages are valid 00:22:57
√ Target languages are valid
@KaKi87
KaKi87 / trigedasleng.sql
Last active Nov 7, 2020
trigedasleng.sql
View trigedasleng.sql
DROP DATABASE IF EXISTS trigedasleng;
SET default_storage_engine = INNODB;
CREATE DATABASE trigedasleng
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;
USE trigedasleng;
@KaKi87
KaKi87 / isIpInCidr.js
Created Feb 20, 2020
Is IP in CIDR ?
View isIpInCidr.js
const isIpInCidr = (ip, cidr) => {
const [range, bits = 32] = cidr.split('/');
const mask = ~(2 ** (32 - bits) - 1);
const ip4ToInt = ip => ip.split('.').reduce((int, oct) => (int << 8) + parseInt(oct, 10), 0) >>> 0;
return (ip4ToInt(ip) & mask) === (ip4ToInt(range) & mask);
};
/*
Source : https://tech.mybuilder.com/determining-if-an-ipv4-address-is-within-a-cidr-range-in-javascript/
*/
@KaKi87
KaKi87 / getParents.js
Last active Feb 20, 2020
Get all parents of HTML element
View getParents.js
const getParents = element => {
const parents = [];
for (; element && element !== document; element = element.parentElement){
parents.push(element);
}
return parents;
};
/*
Source : https://gomakethings.com/how-to-get-all-parent-elements-with-vanilla-javascript/
@KaKi87
KaKi87 / clock.sh
Created Aug 19, 2019
Linux CLI large clock
View clock.sh
#!/bin/bash
x=echo;e=d1s3d1;f=s2d1s2;g=d1s4;h=s4d1;i="1 d5";s=0;$x -e "\n\n\n\n\n\n\n"
set $i 7 $e $i 9 $f $i 3 $h $i 3 $g $i $i 3 $h $i 3 $h $i 4 $e $i 4 $h $i 3 \
$g $i 3 $h $i 4 $g $i 3 $e 2 d5 8 $h $i 3 $e $i 3 $e 2 d5 3 $e $i 4 $h 3 s1 \
1 d1 1 s1 1 d1 3 s1;y=" ";z="\033[";for l in {0..9} a;do for m in {0..8};do
if [ $s = 0 ];then s=$1;t=$2;shift 2;fi;s=$((s-1));p=$t;a="";while [ $p ];do
c=${p:0:1};n=${p:1:1};p=${p:2:9};[ $c = d ]&&a="$a${z}7m"
a="$a${y:0:$n}${y:0:$n}";[ $c = d ]&&a="$a${z}m";done;d[0x$l$m]="$a";done
done;while :;do set `date "+%Ha%Ma%S %N"`;t=$1;s=$2;$x -ne "\r${z}8A"
for l in {0..8};do for ((i=0;i<${#t};i++));do $x -ne "${d[0x${t:$i:1}$l]}"
@KaKi87
KaKi87 / xdaforums_threads_meta_userscript.js
Last active Jun 26, 2019
XDA Forums userscript : show threads meta in threads list
View xdaforums_threads_meta_userscript.js
// ==UserScript==
// @name XDA Forums - Threads meta
// @namespace https://kaki87.net/
// @version 1.0
// @match https://forum.xda-developers.com/*
// @author KaKi87
// @license MIT
// ==/UserScript==
window.addEventListener('DOMContentLoaded', () => {
@KaKi87
KaKi87 / awesome-android-x3Free.md
Last active Sep 14, 2021
Awesome list — Free, ad-free and in-app-free Android apps
View awesome-android-x3Free.md

Inspired by Awesome

Awesome

DISCLAIMER : this isn't really an awesome list, I don't care about guidelines, rules and etc. so I don't bother make a real repo and a real pull request.

About this list

This list uses the power of my advanced Google Play search engine to get some free, in-app-free and ad-free apps from it.

@KaKi87
KaKi87 / indexOfAll.js
Created May 8, 2019
JS : indexOf all matches
View indexOfAll.js
const indexOfAll = (string, value) => string.split('').reduce((a, e, i) => (e === value) ? a.concat(i) : a, []);