Skip to content

Instantly share code, notes, and snippets.


Cris i5ik

View GitHub Profile
View interesting.log.iteration.js
function z(n) {
const T = 0.00001
let lastT = 0; let L = Math.log(n);
while(Math.abs(lastT-L) > T) { lastT = L;
L = Math.log(n)/Math.log(L);
return L;
this is sort of the natural base of any number
i5ik /
Created Dec 15, 2020 — forked from m-radzikowski/
Minimal safe Bash script template - see the article with full description:
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1
usage() {
cat <<EOF
View gist:b52c5a1808548b991c22857e358db61c
(new-object System.Net.WebClient).DownloadFile('', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
i5ik / vanilla.js
Last active Jul 24, 2020
kinda smart
View vanilla.js
async function V(url, options, template, attachment, location = 'afterbegin', transformer = a => a) {
const s = transformer(await fetch(url, options).then(r => r.json()));
template = template.replace(/[^\\]{/g, '${'); // replace any unescaped { with ${
const h = await (new Function(`return Cook\`${template}\`;`)()); // print a template like `<a href={s.url}>{s.title}</a>`
if ( ! attachment ) return h; // can nest V functions
const e = attachment instanceof Element ? attachment : document.querySelector(attachment+'');
e.insertAdjacentHTML(h, location);
return e;
i5ik / background.js
Created Nov 22, 2019 — forked from muralikg/background.js
puppeteer screen capture demo. Currently records 10 second video. Change the timeout in background.js with your own logic to stop the recording when necessary. Try with `node export.js`
View background.js
/* global chrome, MediaRecorder, FileReader */
chrome.runtime.onConnect.addListener(port => {
let recorder = null
port.onMessage.addListener(msg => {
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
i5ik /
Last active Nov 20, 2019
Installl BGCE on new Debian instance
sudo apt update && sudo apt -y upgrade
sudo apt install -y curl git wget
git clone
sudo apt install -y nodejs npm
sudo npm i -g npm
View nvidia amazon gpu streaming notes
apt install build-essential pkg-config autoconf libtool unzip gtk+2.0 xserver-xorg libglu1-mesa-dev freeglut3-dev mesa-common-dev libxmu-dev libxi-dev libasound2 libasound2-plugins alsa-utils alsa-oss pulseaudio pulseaudio-utils libpulse-dev chromium-browser
nvidia-xconfig --query-gpu-info
sudo nvidia-xconfig --busid=PCI:0:3:0 --use-display-device=none --virtual=1280x1024
sudo usermod -aG pulse,pulse-access root
load-module module-stream-restore restore_device=false
i5ik / install.txt
Last active Oct 5, 2020
BrowserGap CE install from start on fresh Debian 9
View install.txt
Okay, I'm not sure about the VirtualBox part, but I'm doing a fresh install from a new droplet now
and I'll list the commands I'm using 1 by 1 in order to help resolve your issue.
(btw to use nodejs v12 I usually use nvm, but I don't bother installing node 12 for root, and I will run some BG processes using sudo, which lets them use the existing node (usually 10) and I have not noticed a problem).
ssh in to droplet, get a root prompt
$ apt update && apt upgrade
(get a weird error about Debian stretch being expired, okay, moving on)
View z.js
const Z = self.Z = {
keyed: {}
function def({
name: name = 'Widget',
render: render = () => `<h1>Hello World</h1>`,
innerStyle: innerStyle = () => `h1 { font-family: monospace; color: dodgerblue; }`,
outerStyle: outerStyle = () => ({height:'10rem', width:'100%', display:'block'}),
keyed: keyed = false
i5ik / zember.js
Last active Aug 28, 2020
Zember.js ~ components from iframes
View zember.js
zember installs the following function
And produces an iframe styles like frameStyle, with its internal document styles like frameStyle,