Skip to content

Instantly share code, notes, and snippets.

Avatar
🌊
Also https://gitlab.com/dosycorp

Cris Stringfellow c9fe

🌊
Also https://gitlab.com/dosycorp
View GitHub Profile
View gist:b52c5a1808548b991c22857e358db61c
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@c9fe
c9fe / 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;
@c9fe
c9fe / 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 => {
console.log(msg);
switch (msg.type) {
case 'REC_STOP':
console.log('Stopping recording')
if (!port.recorderPlaying || !recorder) {
@c9fe
c9fe / install.sh
Last active Nov 20, 2019
Installl BGCE on new Debian instance
View install.sh
sudo apt update && sudo apt -y upgrade
sudo apt install -y curl git wget
git clone https://github.com/dosycorp/browsergap.ce.git
sudo apt install -y nodejs npm
sudo npm i -g npm
./setup_machine.sh
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
http://us.download.nvidia.com/XFree86/Linux-x86_64/410.93/NVIDIA-Linux-x86_64-410.93.run
nvidia-xconfig --query-gpu-info
sudo nvidia-xconfig --busid=PCI:0:3:0 --use-display-device=none --virtual=1280x1024
nodejs
sudo usermod -aG pulse,pulse-access root
/etc/pulse/default.pa
load-module module-stream-restore restore_device=false
https://gist.github.com/jniltinho/9c009e9771651aa4a004ad3d1f6857e3
https://bitbucket.org/goempirical/bullman/get/bcc1b7ae6eb9.zip
@c9fe
c9fe / 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
@c9fe
c9fe / zember.js
Last active Aug 28, 2020
Zember.js ~ components from iframes
View zember.js
zember installs the following function
document.createComponent(
markup,
frameStyle,
innerStyle,
code
);
And produces an iframe styles like frameStyle, with its internal document styles like frameStyle,
@c9fe
c9fe / cell-masking.vba
Created Oct 6, 2019
cell masking with a password
View cell-masking.vba
'Full code on finish
'You can change H4, 6, 26, and H to other cell references
Function KeyCell() As String
KeyCell =3D "H4"
End Function
Function RowStart() As Integer
RowStart =3D 6
End Function
@c9fe
c9fe / README.md
Last active Aug 28, 2020
Theorem∎ X Cris September 7 2019 Test
View README.md

How to run this program?

Download the 3 files: index.html, flatten.js, and tests.js into 1 directory and open index.html with a web browser.

Open the JavaScript console to see test output.

You can’t perform that action at this time.