Skip to content

Instantly share code, notes, and snippets.

@rofrol
rofrol / machine.js
Last active February 11, 2021 14:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
@rofrol
rofrol / machine.js
Created February 11, 2021 13:46
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@rofrol
rofrol / dns-sync.sh
Last active August 31, 2020 08:15 — forked from matthiassb/dns-sync.sh
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@rofrol
rofrol / UrlSearchParams_confused.js
Last active June 3, 2020 13:04
Why it does not console.log cf_callType?
{
const callFormPrefix = 'cf_';
let searchParams = new URLSearchParams("MDN=12341234&cf_mdn=12341234&cf_callReason=R3&cf_callType=Escalation");
console.log(searchParams.toString());
for (let [key] of searchParams) {
console.log('key', key)
if (key.startsWith(callFormPrefix)) {
console.log('starts2:', key)
searchParams.delete(key);
}
  • 61.49 brutto 600 mb/s 24 mc
    • 86 brutto z tv
    • po 21 mc można renegocjować
  • 67.64 brutto 12 mc,
  • rozmawiałem z: Joanna Łątkowska
// https://dmitripavlutin.com/react-hooks-stale-closures/
function createIncrementFixed(i) {
let value = 0;
function increment() {
value += i;
console.log(value);
return function logValue() {
const message = `Current value is ${value}`;
console.log(message);
@rofrol
rofrol / watched.txt
Last active April 1, 2020 19:28
watched.md
'[AgusiQ-TorrentS.pl] Contratiempo.2016.NAPISY PL-MX [AgusiQ]'
'[ALETORRENTY.PL]Savior (1998)-alE13'
'[Devil-TorrentS.pl] Klaus.2019.PLDUB.1080p.NF.WEB-DL.x264.AC3-KiT'
'000Bruce Lee'
'12 Years a Slave (2013)'
'12.Strong.2018.1080p.BluRay.x264-GECKOS[rarbg]'
'3 Days to Kill (2014)'
''\''71 (2014) [1080p]'
A.Quiet.Place.2018.Multi.UHD.2160p.BluRay.x265.HDR.Atmos.7.1-DTOne
Abominable.2019.1080p.WEB-DL.DD5.1.H264-FGT
(function() {
/* This function forces rustdoc to collapse documentation for all items,
except for the methods defined in an impl block and the primary type's
declaration. This is the most natural view IMO, since it provides the
primary type along with an easy to scan overview of available methods.
rustdoc does seemingly have user settings that purport to make this the
default, but I could never cause them to work in a reliably consistent
way. This is especially useful when writing documents, where you commonly
want to refresh and look at the docs for the specific item you're working
function flatten(array) {
let i = 0;
while (i < array.length) {
if (!Array.isArray(array[i])) {
i++
} else {
array.splice(i, 1, ...array[i])
}
}
}
@rofrol
rofrol / Explain Monad using Elm.md
Last active March 25, 2020 01:40
Explain Monad using Elm - WIP