Skip to content

Instantly share code, notes, and snippets.

View modster's full-sized avatar
🧠

EM Greeff modster

🧠
View GitHub Profile
@modster
modster / confetti.js
Created December 15, 2021 10:27
Confetti
// We can import code dynamically, top level await is supported.
const {default: Confetti} = await import('https://cdn.skypack.dev/canvas-confetti');
function fireConfetti(event) {
const x = event.clientX / document.body.clientWidth;
const y = event.clientY / document.body.clientHeight;
Confetti({origin: {x, y}});
}
// lit templating is built-in
@modster
modster / license.md
Created December 15, 2021 10:46
License Types

apache-2.0 bsd-2-clause bsd-3-clause cc-by-4.0 cc-by-nc-4.0 cc-by-nc-nd-4.0 cc-by-nc-sa-4.0 cc-by-nd-4.0 cc-by-sa-4.0 cddl-1.0

@modster
modster / bl.ocks.org.md
Created December 15, 2021 10:48
Bl.ocks.org

Bl.ocks

A simple viewer for sharing code examples hosted on GitHub Gist. For example, if your Gist URL is:

https://gist.github.com/mbostock/1353700

Replace “gist.github.com” with “bl.ocks.org” in the URL to view it:

https://bl.ocks.org/mbostock/1353700

The main source for your example is in index.html. This file can contain relative links to other files in your Gist, such as images, scripts or stylesheets. And of course you can use absolute links, such as CDN-hosted D3, jQuery or Leaflet. To explain your example, add a README.md written in Markdown. (You can omit the index.html if you just want to write, too.)

@modster
modster / tachyons.md
Last active December 15, 2021 11:51
Tachyons

Tachyons

git clone [email protected]:tachyons-css/tachyons.git
cd tachyons
rm -rf .git && git init
npm install && npm start
@modster
modster / _http_serverr.js
Created December 16, 2021 01:37
HTTP STATUS_CODES
const STATUS_CODES = {
100: 'Continue', // RFC 7231 6.2.1
101: 'Switching Protocols', // RFC 7231 6.2.2
102: 'Processing', // RFC 2518 10.1 (obsoleted by RFC 4918)
103: 'Early Hints', // RFC 8297 2
200: 'OK', // RFC 7231 6.3.1
201: 'Created', // RFC 7231 6.3.2
202: 'Accepted', // RFC 7231 6.3.3
203: 'Non-Authoritative Information', // RFC 7231 6.3.4
@modster
modster / electron.md
Created December 16, 2021 01:41
Electron Installers

Related

https://github.com/electron/electron-packager#related

Electron Forge - creates, builds, and distributes modern Electron applications electron-packager-interactive - an interactive CLI for electron-packager grunt-electron - grunt plugin for electron-packager Distributable Creators electron-installer-zip - creates symlink-compatible ZIP files Windows:

@modster
modster / repl-client.js
Created December 16, 2021 01:42 — forked from TooTallNate/repl-client.js
Running a "full-featured" REPL using a net.Server and net.Socket
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@modster
modster / .block
Created December 16, 2021 02:03 — forked from mbostock/.block
Epicyclic Gearing
license: gpl-3.0
redirect: https://observablehq.com/@mbostock/epicyclic-gearing
@modster
modster / index.html
Created December 16, 2021 23:50
BrowserWindowTransparency
<!DOCTYPE html>
<html lang="en">
<head>
<title>BrowserWindow</title>
</head>
<body>
<h1>Hello from your BrowserWindow!</h1>
<button id="close-btn">Close this window</button>
<script>
const button = document.querySelector('#close-btn')
@modster
modster / main.js
Created December 17, 2021 01:47
ElectronTray
// Add icons and context menus to the system's notification area.
//
// For more info, see:
// https://electronjs.org/docs/api/tray
const { app, Tray, Menu, nativeImage } = require('electron')
let tray
app.whenReady().then(() => {