Skip to content

Instantly share code, notes, and snippets.

@rofrol
rofrol / script-calculator.js
Created September 10, 2021 20:55 — forked from tchayen/script-calculator.js
Javascript calculator using Reverse Polish notation and Shunting-yard algorithm
// function connecting algorithm with outer world
function updateCalculator(event) {
var expression = document.getElementById("calculator").value;
var result = calculate(expression);
document.getElementById('calculatorResult').innerHTML = result;
}
function calculate(expression) {
  • +81 Japan
  • +89 —
  • +41 Switzerland
  • +61 Australia
  • +964 Iraq
  • +370 Lithuania
  • +43 Austria
  • +355 Albania
  • +216 Tunisia
  • +7 Russia
+import { useTheme } from '@material-ui/core/styles'
+import useMediaQuery from '@material-ui/core/useMediaQuery'

 const useAppBarStyles = makeStyles((theme) => ({
   root: {
@@ -25,6 +27,8 @@ const useToolbarStyles = makeStyles((theme) => ({
 function Header() {
   const appBarStyles = useAppBarStyles()
   const toolBarStyles = useToolbarStyles()
@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