Skip to content

Instantly share code, notes, and snippets.

View matthiasak's full-sized avatar
📘
@hashicorp Terraform 💯 expression engine builds dep-trees of values

Matt Keas matthiasak

📘
@hashicorp Terraform 💯 expression engine builds dep-trees of values
  • Google
  • Houston, TX
View GitHub Profile
@matthiasak
matthiasak / diy-routing.js
Last active March 28, 2016 16:51
Copy the following code into https://matthiasak.github.io/arbiter-frame/#// to see it run
const router = (routes, fn=(a,b)=>a(b)) => {
let current = null
const listen = () => {
window.addEventListener('hashchange', () => {
trigger(window.location.hashname.slice(1))
})
}
const trigger = path => {
// simple fn that returns a map node
const node = (val=undefined) => {
let result = {}
if(val) result.val = val
return result
}
// hash fn
const hash = str => {
if(typeof str !== 'string') str = JSON.stringify(str)
@matthiasak
matthiasak / react-iso.js
Created May 10, 2016 16:12
react-iso.js
import polyfill from "babel-polyfill"
const cluster = require('cluster')
import _router from 'koa-router'
const router = _router()
// middleware
import stat from 'koa-serve-static'
import conditional from 'koa-conditional-get'
import bodyParser from 'koa-bodyparser'
let items = [
{category: "Sporting Goods", price: "$49.99", stocked: true, name: "Football"},
{category: "Sporting Goods", price: "$9.99", stocked: true, name: "Baseball"},
{category: "Sporting Goods", price: "$29.99", stocked: false, name: "Basketball"},
{category: "Electronics", price: "$99.99", stocked: true, name: "iPod Touch"},
{category: "Electronics", price: "$399.99", stocked: false, name: "iPhone 5"},
{category: "Electronics", price: "$199.99", stocked: true, name: "Nexus 7"}
]
const app = () => {
@matthiasak
matthiasak / reclaimWindows10.ps1
Created January 9, 2017 03:10 — forked from alirobe/reclaimWindows10.ps1
"Reclaim Windows 10" turns off a bunch of unnecessary Windows 10 telemetery, removes bloatware, and privacy invasions. Review and tweak before running. Scripts for reversing are included and commented. Fork via https://github.com/Disassembler0 (different defaults)
##########
# Win10 Initial Setup Script
# Author: Disassembler <disassembler@dasm.cz>
# Version: 1.7, 2016-08-15
# dasm's script: https://github.com/Disassembler0/Win10-Initial-Setup-Script/
# THIS IS A PERSONALIZED VERSION
# This script leaves more MS defaults on, including MS security features.
# Tweaked based on personal preferences for @alirobe 2016-11-16 - v1.7.1
module.exports = {
config: {
openDevToolsKey: 'CommandOrControl+I',
// default font size in pixels for all tabs
fontSize: 12,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
@matthiasak
matthiasak / inlineworker.js
Created January 16, 2017 01:19 — forked from SunboX/inlineworker.js
Create web workers without a separate worker JS files. Source: http://jsbin.com/owogib/8/
function worker() {
setInterval(function() {
postMessage({foo: "bar"});
}, 1000);
}
var code = worker.toString();
code = code.substring(code.indexOf("{")+1, code.lastIndexOf("}"));
var blob = new Blob([code], {type: "application/javascript"});
@matthiasak
matthiasak / ko.js
Created February 7, 2017 04:09
ko.js example
// copy and paste into https://matthiasak.github.io/arbiter-frame/
document.head.innerHTML += `<style> body { background: #efefef; } </style>`
document.body.innerHTML = `
<p>First name: <input data-bind="value: first" /></p>
<p>Last name: <input data-bind='value: last, valueUpdate: "afterkeydown"' /></p>
<h2>Hello, <span data-bind="text: full"> </span>!</h2>
<hr/>
sorta'ish notes:
# talk notes
- Fanflow
- Preact, Typescript, Fusebox (vs. Webpack), GraphQL, PostCSS, immutable deployments, Docker, Responsive Web Design
- package.json (TOC)
- dependencies
- scripts
- services used (graph.cool, now.sh, snyk, github, auth0, sentry.io, browserstack)