Skip to content

Instantly share code, notes, and snippets.

View kmorin's full-sized avatar

Kyle Morin kmorin

  • Seattle
View GitHub Profile
@kmorin
kmorin / machine.js
Created September 2, 2022 18:18
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
{
"editor.fontFamily": "'Fira Code', 'Victor Mono'",
"editor.fontLigatures": true,
"editor.fontWeight": "400",
"editor.letterSpacing": 0.2,
"editor.fontSize": 14,
"editor.renderWhitespace": "selection",
"bracket-pair-colorizer-2.colors": [
"#d08770e8",
"#8fbcbbe8",
/* CSS */
--eerie-black: hsla(0, 0%, 8%, 1);
--baby-powder: hsla(82, 3%, 100%, 1);
--bittersweet: hsla(1, 61%, 100%, 1);
--space-cadet: hsla(248, 45%, 38%, 1);
--green-lizard: hsla(82, 70%, 96%, 1);
/* SCSS HEX */
$eerie-black: #141414ff;
$baby-powder: #fcfff7ff;
@kmorin
kmorin / babylonjs-glb-scene-loader.ts
Created June 15, 2020 23:54
glb loader babylonjs
import { Engine } from '@babylonjs/core/Engines/engine';
import { Scene } from '@babylonjs/core/scene';
import { SceneLoader, Vector3, HemisphericLight, ArcRotateCamera } from '@babylonjs/core';
import '@babylonjs/loaders/glTF';
import 'pepjs';
window.addEventListener('DOMContentLoaded', function () {
let glbFile = "sci-fi-room.glb";
// let glbFile = "pbr-spheres.gltf";

Keybase proof

I hereby claim:

  • I am kmorin on github.
  • I am kylemorin (https://keybase.io/kylemorin) on keybase.
  • I have a public key ASDPVAP6foCY7-o1hytbshJLPpbOMnPnTtogR03IXsngdAo

To claim this, I am signing this object:

@kmorin
kmorin / web-servers.md
Last active February 14, 2018 15:47 — forked from willurd/web-servers.md
http static server one-liners

Each of these commands will run an ad-hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@kmorin
kmorin / ReadWriteRevitIni
Last active February 14, 2018 22:00
read and parse + update RevitINI files from custom actions
public static void ReadWriteRevitIniPaths() {
var iniLocations = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Autodesk", "Revit");
foreach (var dir in Directory.GetDirectories(iniLocations)) {
if (dir.Contains("Addins")) { continue; }
foreach (var file in Directory.GetFiles(dir)) {
if (!Path.GetFileName(file).Equals("Revit.ini")) { continue; }
var contents = File.ReadAllLines(file);
//setup dictionary
var dict = new Dictionary<string, List<string>>();
This file has been truncated, but you can view the full file.
{
"REBAR_WORKSHOP_INSTRUCTIONS": [
{
"lang": "CHS",
"value": "车间说明"
},
{
"lang": "CHT",
"value": "介紹指示"
},
@kmorin
kmorin / getGrays.cs
Last active September 12, 2017 17:24
retrive int[] of all grays code combinations
private IEnumerable<int[]> getGrays(int n) {
//if n is > 24 memory fails
if (n <= 0 || n > 24) { return null; }
var ar = new List<string> { "0", "1" };
for (var i = 2; i < 1 << n; i = i << 1) {
for (var j = i - 1; j >= 0; j--) { ar.Add(ar[j]); }
for (var j = 0; j < i; j++) { ar[j] = $"0{ar[j]}"; }
for (var j = i; j < 2 * i; j++) { ar[j] = $"1{ar[j]}"; }
}
var returnAr = new List<int[]>();
@kmorin
kmorin / updateCLtools.sh
Created February 29, 2016 15:12
update script for command-line tools [osx]
#!/bin/bash
echo 'Updating Homebrew...'
brew update
echo 'Updating RVM...'
rvm get stable
echo 'Updating NVM...'
curl -o- https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
echo 'Upgrading git...'
brew upgrade