Skip to content

Instantly share code, notes, and snippets.

View kmorin's full-sized avatar

Kyle Morin kmorin

  • Seattle
View GitHub Profile
@kmorin
kmorin / gist:1803071
Created February 11, 2012 17:44
programmer quote
programmers lie frequently about being math geniuses when they really aren't. If they were math geniuses, they would be doing math, not writing ads and social network games to steal people's money
@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
@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[]>();
This file has been truncated, but you can view the full file.
{
"REBAR_WORKSHOP_INSTRUCTIONS": [
{
"lang": "CHS",
"value": "车间说明"
},
{
"lang": "CHT",
"value": "介紹指示"
},
@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>>();
@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

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 / 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";
/* 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;
{
"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",