Skip to content

Instantly share code, notes, and snippets.

@mmocny
mmocny / inp-devtools-watch.js
Created April 14, 2023 14:12
Add these snippets to DevTools (console) Watch expressions
// max-INP:
(()=>{let o=globalThis;return void 0===o.winp&&(o.winp=0,new PerformanceObserver(n=>{for(let e of n.getEntries()){if(!e.interactionId)continue;o.winp=Math.max(e.duration,o.winp);let r=o=>o<=200?"color: green":o<=500?"color: yellow":"color: red";console.log(`%c[Interaction: ${e.name.padEnd(12)}] %cDuration: %c${e.duration}`,"color: grey; font-family: Consolas,monospace","",r(e.duration))}}).observe({type:"event",durationThreshold:0,buffered:!0})),o.winp})();
// interactionCount
performance.interactionCount;
import Benchmark from "benchmark";
const datetimeValidationSuite = new Benchmark.Suite("datetime");
const DATA = "2020-01-01";
const MONTHS_31 = new Set([1, 3, 5, 7, 8, 10, 12]);
const MONTHS_30 = new Set([4, 6, 9, 11]);
const simpleDatetimeRegex = /^(\d{4})-(\d{2})-(\d{2})$/;
const datetimeRegexNoLeapYearValidation =
@catalinmiron
catalinmiron / README.md
Created April 16, 2024 20:36
Expo app.json Apple Privacy Manifest

About

The privacy details that you may need to add for Apple Privacy Manifest.

This config plugin it's already available from expo >=50.0.17 (Part of this PR by aleqsio)

Tip

Read more about Privacy Manifest File from Apple docs

@li-xunhuan
li-xunhuan / cli.py
Created August 6, 2023 00:16
SmsForwarder使用 SM4 加密主动控制接口Python调用案例
import base64
import hmac
import time
import json
import urllib.parse
from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
class SmsF:
"""

Trashing the Vodafone Station

How to replace the Vodafone Station with your very own router

Vodafone forces its customers to use their modem/router, the "Vodafone Station": using any other router is impossible because authentication is being done via a custom PPPoE setup.
In the PPPoE packet there is a field named Host-Uniq which is used to separate packets from different PPPoE sessions: Vodafone requires the Station serial number to be put in this field as authentication.

Hardware setup

A Linux router with root access is needed to replace the Station with. With an xDSL connection a modem with a custom firmware like OpenWrt has to be used, most likely one based on a Lantiq SoC.
For a FTTH internet connection then every machine with at least two gigabit ethernet interface and a decent CPU will do it.

@ryantm
ryantm / -
Created January 15, 2020 14:40
{ AMB-plugins = { homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/ladspa/index.html"; version = "0.8.1"; }; AgdaSheaves = { homepage = "https://github.com/jonsterling/Agda-Sheaves"; version = "8a06162a8f0f7df308458db91d720cf8f7345d69"; }; AgdaStdlib = { homepage = "http://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary"; version = "1.1"; }; CoinMP = { homepage = "https://projects.coin-or.org/CoinMP/"; version = "1.8.4"; }; EmptyEpsilon = { homepage = "https://daid.github.io/EmptyEpsilon/"; version = "2019.11.01"; }; FIL-plugins = { homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/ladspa/index.html"; version = "0.3.0"; }; Fabric = { homepage = "https://www.fabfile.org/"; version = "2.5.0"; }; LASzip = { homepage = "https://laszip.org"; version = "2.2.0"; }; MMA = { homepage = "http://www.mellowood.ca/mma/index.html"; version = "19.08"; }; PPSSPP = { homepage = "https://www.ppsspp.org/"; version = "1.9.3"; }; QmidiNet = { homepage = "http://qmidinet.sourceforge.net/"; versio
@huzemin
huzemin / laravel-encrypt.js
Created December 3, 2019 06:47
laravel Encrypt convert to CryptoJS in Javascript
import CryptoJS from "crypto-js";
const LaravelEncrypt = function (key) {
this.key = key;
}
LaravelEncrypt.prototype.decrypt = function (encryptStr) {
encryptStr = CryptoJS.enc.Base64.parse(encryptStr);
let encryptData = encryptStr.toString(CryptoJS.enc.Utf8);
encryptData = JSON.parse(encryptData);
@Southclaws
Southclaws / github-release-downloads.sh
Created July 3, 2018 13:27
Count total downloads from GitHub releases using the GitHub API v3 and a simple jq expression
#!/usr/bin/env sh
# https://jqplay.org/s/CpDPlGueMM
# usage: `github-release-downloads.sh Username/Repository`
curl -s https://api.github.com/repos/$1/releases |
jq '[.[].assets | .[].download_count] | add' -
@Jekins
Jekins / Markdown-docs.md
Last active April 18, 2024 09:56
Руководство по оформлению Markdown файлов

Руководство по оформлению Markdown файлов

Markdown - это облегчённый язык разметки, который преобразует текст в структурированный HTML. Следующее руководство поможет вам разобраться, как использовать Markdown.

Заголовки

# Заголовок первого уровня
## Заголовок второго уровня
### Заголовок третьего уровня
#### Заголовок четвёртого уровня
##### Заголовок пятого уровня