Skip to content

Instantly share code, notes, and snippets.

Avatar

John Haugeland StoneCypher

View GitHub Profile
@StoneCypher
StoneCypher / learn_peerjs.js
Created May 30, 2021
Example of `parcelRequire` bug is at line 21, column 890
View learn_peerjs.js
var learn_peerjs = (function (exports) {
'use strict';
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
function commonjsRequire (path) {
View How to load the WhatIsMyBrowser user agent database.md

How to load WIMB database

mysql -u your_user -p
(when prompted, put in password; now mysql prompt)
create database user_agents;
exit
mysql -u your_user -p user_agents < create-table-whatismybrowser_useragent.sql
mysql -u your_user -p user_agents -e "ALTER TABLE whatismybrowser_useragent DISABLE KEYS;"
mysql -u your_user -p user_agents < whatismybrowser-user-agent-database.sql
View puppeteer popup.md

How to fix that Puppeteer popup

... what puppeteer popup?

Or, "Do you want to the application Chromium.app to accept incoming network connections?"

This popup can be very annoying when running your testset headed. None of the relevant memes are work appropriate.

View foo.md
Header Header Right
Cell Cell $10
Cell Cell $20
@StoneCypher
StoneCypher / Learning JS.md
Created Mar 18, 2018 — forked from Ehawk82/LearningJS.md
(Jason's) experience in learning JS
View Learning JS.md

Scope & Timeline. Troubleshooting takes time and it's painful when the problem is because of where something is written in respect to other things. "Return functions". I wish i learned to do this earlier. Instead of writing "document.get[thing]" over and over again sucks. So creating a return function in my global object is a great timesaver... something like UI.bySelect("#tag") and UI.byTag("body"). I believe this is also a good way to learn how to use parameters Parameters. Specifically about the scope of where a variable is named. I found that there are times where i'll use "x", "y" for a generic variable to pass as a parameter. This means the previous function will try to pass their variable in those spots. This is something to pay attention to when using more than two parameters Using setTimeout() to delay a className change. This is something that i spent a lot of time and code on to do things, only to find out that a simple timeout can delay a change momentarity. This is important when l

View agnosticism.md

Citing Huxley's Collected Essays Vol 5

When I reached intellectual maturity and began to ask myself whether I was an atheist, a theist, or a pantheist; a materialist or an idealist; a Christian or a freethinker; I found that the more I learned and reflected, the less ready was the answer; until, at last, I came to the conclusion that I had neither art nor part with any of these denominations, except the last. The one thing in which most of these good people were agreed was the one thing in which I differed from them. They were quite sure they had attained a certain "gnosis,"—had, more or less successfully, solved the problem of existence; while I was quite sure I had not, and had a pretty strong conviction that the problem was insoluble. And, with Hume and Kant on my side, I could not think myself presumptuous in holding fast by that opinion. Like Dante,

Nel mezzo del cammin di nostra vita

Mi ritrovai per una selva oscura,

but, unlike Dante,

View raganwald.fsl
machine_name: "Raganwald's example";
machine_source: http://raganwald.com/2018/02/23/forde.html ;
start_states: open;
initial_data: { balance: 0 };
open 'deposit' { onfollow: `${(action, data) => ((data.balance += action.amount), data)}`; } -> open;
open 'withdraw' { onfollow: `${(action, data) => ((data.balance -= action.amount), data)}`; } -> open;
@StoneCypher
StoneCypher / ltdf.html
Created Jan 3, 2018
learn the debugger francisco
View ltdf.html
<!doctype html><html><head><script type="text/javascript">
const Num1 = 500;
const Num2 = 0500; // this is the bug, but let's say that you don't know about octal
const finalNum = Num1 + Num2;
window.onload = () =>
document.body.innerHTML = `Should print 1000: <tt>${finalNum}</tt>`;
@StoneCypher
StoneCypher / Toy react bootstrap from CDN.html
Last active Jan 8, 2018
Toy react bootstrap from CDN for Francisco
View Toy react bootstrap from CDN.html
<!doctype html>
<html>
<head>
<script src="https://fb.me/react-15.0.0.js"></script>
<script src="https://fb.me/react-dom-15.0.0.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
<script type="text/babel">
View keybase.md

Keybase proof

I hereby claim:

  • I am StoneCypher on github.
  • I am johnhaugeland (https://keybase.io/johnhaugeland) on keybase.
  • I have a public key whose fingerprint is 64BF D8FA 55C2 0A13 1F2E 33BF 5224 78B4 0318 743C

To claim this, I am signing this object: