Skip to content

Instantly share code, notes, and snippets.

@jondashkyle
jondashkyle / switch.js
Last active April 8, 2021 15:24
Switch it up
// Pseudo-code of a pattern I use frequently.
const theTitle = 'Seeing is forgetting the name of the thing one sees'
const isActive = true
const duration = 420
switch (true) {
case !!theTitle:
return 'Has a title!'
case isActive && duration > 300:
@jondashkyle
jondashkyle / machine.js
Last active February 5, 2021 20:25
Generated by XState Viz: https://xstate.js.org/viz
const onboardingMachineConfig = Machine(
{
key: 'onboarding',
initial: 'disconnected',
context: {
ensLabel: '',
walletAddress: '',
writeAmount: 0,
isTokenCanvasLoaded: false,
isENSAvailable: false,

Keybase proof

I hereby claim:

  • I am jondashkyle on github.
  • I am jkm (https://keybase.io/jkm) on keybase.
  • I have a public key ASDQ_bJp2caeHkpTuwoE9eZ5bdxr5cPkibnOHrl5VmBbQwo

To claim this, I am signing this object:

@jondashkyle
jondashkyle / SketchSystems.spec
Last active August 28, 2018 20:15
PoemPortraits
PoemPortraits
Contribute*
ContributeInputEmpty*
INPUT -> ContributeInputPopulated
ContributeInputPopulated
SUBMIT -> ContributeInputSubmit
/**
* mass-unfollow console scripts
*
* 1. navigate to your follower page on the related platform
* 2. open developer tools
* 3. copy and paste
* 4. press ENTER to run
* 5. rinse and repeat if pagination
*/
@jondashkyle
jondashkyle / peers.js
Created April 21, 2018 15:47
polling for peers
// https://beakerbrowser.com/docs/apis/dat.html#getinfo
var archive = new DatArchive(window.location.toString())
var peers = 0
setInterval(checkPeers, 2000)
async function checkPeers () {
var info = await archive.getInfo()
peers = info.peers
@jondashkyle
jondashkyle / entry.json
Created April 18, 2018 16:57
enoki p2p web log blueprint
{
"title": "Entry",
"pages": false,
"fields": {
"title": {
"label": "Title",
"type": "text"
},
"source": {
"label": "Source",
@jondashkyle
jondashkyle / tricks.css
Last active April 5, 2017 16:27
css tricks
/**
* hide the cursor in an input field
*/
input {
color: transparent;
text-shadow: 0 0 0 #fff;
}
/**
* blink

Keybase proof

I hereby claim:

  • I am jondashkyle on github.
  • I am jkm (https://keybase.io/jkm) on keybase.
  • I have a public key whose fingerprint is 9697 C5D7 54D7 60B4 308E EB4D 292B E8BE E136 F72C

To claim this, I am signing this object:

/**
* A reset for Kirby’s panel
* Work in progress
*
* Installation
* - Create CSS file inside your site’s assets directory
* - Open config.php and add the following line
* c::set('panel.stylesheet', 'assets/panel.css');
* - Adjust to your liking
*/