Skip to content

Instantly share code, notes, and snippets.

View colinbate's full-sized avatar

Colin Bate colinbate

View GitHub Profile
@colinbate
colinbate / machine.js
Last active June 13, 2020 20:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
Verifying my Blockstack ID is secured with the address 1L5aWqjyDSp8JWaTvQsToQm2GaYxvoTkpA https://explorer.blockstack.org/address/1L5aWqjyDSp8JWaTvQsToQm2GaYxvoTkpA
@colinbate
colinbate / Sample.svelte
Created April 29, 2019 04:09
Svelte 3 custom element events
<script>
import { createEventDispatcher } from 'svelte';
let firstName = '';
const dispatch = createEventDispatcher();
function save() {
dispatch('save', {
firstName
});

Keybase proof

I hereby claim:

  • I am colinbate on github.
  • I am colinbate (https://keybase.io/colinbate) on keybase.
  • I have a public key ASDIbdN_KSmwoRL4XiN5nNp7pP-jJuQHmsWuw5FtJVcH1Ao

To claim this, I am signing this object:

@colinbate
colinbate / find-unusedfilename.ps1
Created November 6, 2015 19:16
Find-UnusedFilename
function Find-UnusedFilename
{
param (
[string]$folder,
[string]$filename
)
if (-not (Test-Path (Join-Path $folder $filename)))
{
return Join-Path $folder $filename
}
@colinbate
colinbate / create-keyed-array.js
Created March 13, 2014 17:32
Create a map from an array of similar objects
function createKeyedArray (keyName, arr) {
var ii, obj = {};
for (ii = 0; ii < arr.length; ii += 1) {
obj[arr[ii][keyName]] = arr[ii];
}
return obj;
}
@colinbate
colinbate / 0_reuse_code.js
Created March 6, 2014 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Agents</title>
</head>
<body>
<div class="square">
<div class="box">
<div class="agent mr-green"></div>
@colinbate
colinbate / dabblet.css
Created December 31, 2013 14:02
CSS Agent Pawns: An Experiment by Colin Bate
/* CSS Agent Pawns: An Experiment by Colin Bate */
.agent.mr-gray {
background-color: #b8bfb9;
box-shadow: 0px 4px 0 #858C86, 0 5px 3px #444, 0 8px 6px #999;
}
.agent.mr-blue {
background-color: #2569cc;
box-shadow: 0px 4px 0 #003699, 0 5px 3px #444, 0 8px 6px #999;
@colinbate
colinbate / dabblet.css
Created December 31, 2013 13:31 — forked from dcneiner/dabblet.css
CSS Counters: An Experiment by Colin Bate
/* CSS Counters: An Experiment by Colin Bate */
.counter.mr-gray {
background-color: #b8bfb9;
box-shadow: 0px 4px 0 #858C86, 0 5px 3px #444, 0 8px 6px #999;
}
.counter.mr-blue {
background-color: #2569cc;
box-shadow: 0px 4px 0 #003699, 0 5px 3px #444, 0 8px 6px #999;