Skip to content

Instantly share code, notes, and snippets.

@tasinet
tasinet / keybase.md
Created March 30, 2022 16:44
keybase.md

Keybase proof

I hereby claim:

  • I am tasinet on github.
  • I am tasinet (https://keybase.io/tasinet) on keybase.
  • I have a public key whose fingerprint is DA93 1C35 4390 B91F 398A B45F CD72 B602 4816 63F7

To claim this, I am signing this object:

@tasinet
tasinet / diff--left-main--right-worker.txt
Last active July 22, 2021 14:44
Navigator object differences between main frame context and web worker context (Chrome)
4,5d3
< clearAppBadge
< clipboard
7,8d4
< cookieEnabled
< credentials
11d6
< geolocation
13,15d7
< getGamepads
@tasinet
tasinet / i3lock-pixelblock.sh
Last active July 12, 2019 10:42
i3lock with block-cursor style pixelation effect
#!/bin/bash
# Copyright (c) 2013-2014 Artem Shinkarov <artyom.shinkaroff@gmail.com>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@tasinet
tasinet / gist:fb3000a74b65a91ab36896b5f281c47e
Created June 14, 2019 15:55
TextField rowsMax prop change -> Maximum Update Depth Violation
Invariant Violation
Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.
▼ 25 stack frames were expanded.
invariant
https://hqkug.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:55:15
scheduleWork
https://hqkug.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:19916:5
dispatchAction
https://hqkug.codesandbox.io/node_modules/react-dom/cjs/react-dom.development.js:13599:5
Textarea/syncHeight<@https://hqkug.codesandbox.io/node_modules/
@tasinet
tasinet / curl.log
Created June 4, 2019 14:03
Failed curl request mashlol/notify backend
* Trying 2a00:1450:400e:808::200e...
* TCP_NODELAY set
* Connected to us-central1-notify-b7652.cloudfunctions.net (2a00:1450:400e:808::200e) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
} [5 bytes data]
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
@tasinet
tasinet / i3-switch-if-workspace-empty.sh
Last active February 8, 2018 16:26
switch i3 workspace only if current workspace is empty
#!/bin/bash
set -e
new_workspace=$1
if [ "" == "$new_workspace" ]; then
echo expecting workspace name/number
exit 1
fi
@tasinet
tasinet / gist:9cfe55909393a9ebb9c8
Last active August 29, 2015 14:10
Node - http.request - KeepAlive test: traffic results (wireshark)
@tasinet
tasinet / gist:3ad091af55c659e5bd49
Last active August 29, 2015 14:10
Node - http.request - KeepAlive test: traffic generator
//with 0.10.33
//run with -mS1 and watch network: ~ 2 TCP connections, 6 UDP/DNS reqs <-- KeepAliv
//run without an option for maxSockets = 5 (default from globalAgent) and watch network: ~ 100 TCP connections and 400 UDP/DNS req <-- No KeepAlive
//this is modeled sequentially, which is closer to npm install's request pattern (rather than 100 requests fired off at init time)
//results in https://gist.github.com/tasinet/9cfe55909393a9ebb9c8
var https = require('https');
public static function getDateFromMongoId($_id)
{
//first 8 chars of mongoid are hex unix timestamp
$_id = substr( (String)$_id, 0, 8 );
$unix = hexdec($_id);
return date('d/m/Y H:i:s',$unix);
}