Skip to content

Instantly share code, notes, and snippets.

🦉
also at https://gitlab.com/dosycorp

Cris Stringfellow crislin2046

🦉
also at https://gitlab.com/dosycorp
Block or report user

Report or block crislin2046

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View ideas.js
How to make a ?
- better native?
Use browser native,
window.open, select, alert, confirm, prompt, file, print.
OR
@crislin2046
crislin2046 / tester.js
Created Nov 5, 2018 — forked from freedmand/tester.js
JavaScript unit testing in under 30 lines
View tester.js
const PASS = ['32']; // green
const FAIL = ['31', '1']; // red, bold
function logStyle(ansiEscapeCodes, text) {
console.log(`\x1b[${ansiEscapeCodes.join(';')}m${text}\x1b[0m`);
}
class Tester {
constructor() {}
@crislin2046
crislin2046 / pseudo_elements.md
Created Sep 6, 2018 — forked from webtobesocial/pseudo_elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.
View pseudo_elements.md

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@crislin2046
crislin2046 / readme.md
Created Aug 16, 2018 — forked from flbuddymooreiv/readme.md
erlang + rebar + cowboy Hello World
View readme.md

This is the process of setting up erlang, rebar3, and cowboy for a Hello World, starting with a clean Debian 8 install.

Update apt and install deps:

root@046edcaea45a:~# apt-get update
root@046edcaea45a:~# apt-get install erlang erlang-dev gcc
root@046edcaea45a:~# wget https://s3.amazonaws.com/rebar3/rebar3
root@046edcaea45a:~# mkdir ~/bin/
root@046edcaea45a:~# mv rebar3 ~/bin/
root@046edcaea45a:~# chmod +x ~/bin/rebar3 
@crislin2046
crislin2046 / classchange.js
Last active Jul 27, 2018
'classchange' Event - with watchClassChange and addEventListener('classchange', ...)
View classchange.js
"use strict";
{
const config = {attributes: true};
const observer = new MutationObserver(sendEvent);
const listDiff = new WeakMap();
Object.assign(self,{watchClassChange});
function sendEvent(attrChanges) {
attrChanges
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@crislin2046
crislin2046 / explanation.md
Created Apr 18, 2018
Switch Branch + Block Scope : ECMAScript
View explanation.md

Block scope can be used in switch statements. It's sort of a nice syntax that allows you to defined same-named variables without getting 'already defined' errors.

The example is not so great because data could be rewritten to be let data; at the top of the function, rather than in each case block.

Blocking scoping is pretty useful.

@crislin2046
crislin2046 / global_error_catcher.js
Created Mar 29, 2018
Add this 1 liner to your front end code to catch and display errors when debugging on mobile.
View global_error_catcher.js
window.onerror = (m,u,l,c,e) => (alert(`Exception: ${m} @ ${u} line ${l} column ${c}\n${e ? e.stack : ''}`), true);
@crislin2046
crislin2046 / sketch.js
Created Nov 1, 2017
download page html
View sketch.js
"use strict";
{
const page = document.documentElement.outerHTML;
const pageBlob = new Blob([page]);
const objectURL = URL.createObjectURL(pageBlob);
const anchor = document.createElement('a');
anchor.target = "_new";
anchor.setAttribute('download','page.html');
anchor.href = objectURL;
anchor.innerText = 'download page.html';
You can’t perform that action at this time.