Skip to content

Instantly share code, notes, and snippets.

View avanslaars's full-sized avatar

Andy Van Slaars avanslaars

View GitHub Profile
@avanslaars
avanslaars / machine.js
Last active November 12, 2019 18:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@avanslaars
avanslaars / machine.js
Last active November 12, 2019 17:30
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@avanslaars
avanslaars / webpack.config.js
Created May 14, 2018 16:19
Sample config to output multiple HTML files with a single JS bundle for testing multiple React and ReactDOM versions via CDN
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
entry: './src/index.js',
output: {
path: path.join(__dirname, 'build'),
filename: 'app.bundle.js'
},
module: {
@avanslaars
avanslaars / javascript.json
Last active September 27, 2017 15:06
VS Code Custom Settings - settings, keybindings and snippets by language
{
"Print to console": {
"prefix": "log",
"body": ["console.log($1)$2", "$3"],
"description": "Log output to console"
},
"Mocha Before": {
"prefix": "before",
"body": [
"before(() => {",
@avanslaars
avanslaars / styles.less
Created August 29, 2017 10:57
Custom Styles for using Operator Mono in Atom
atom-text-editor
{
font-family: "Operator Mono";
font-weight: 400;
line-height: 1.7;
}
atom-panel.tool-panel {
font-size: 0.88em;
}
@avanslaars
avanslaars / styles.less
Last active April 5, 2017 19:44
Mix attributes from Operator Mono with Fira Code for ligatures
atom-text-editor {
/*font-family: "OperatorMono-Medium";*/
font-family: "Fira Code";
font-size: 18px;
font-weight: normal;
line-height: 1.7;
}
atom-panel.tool-panel {
font-size: 0.88em;
@avanslaars
avanslaars / .gitconfig
Last active August 1, 2017 16:38
Git aliases
[alias]
aliases = config --get-regexp '^alias\\.'
br = branch
branch-name = rev-parse --abbrev-ref HEAD
ci = commit -m
cm = !git add -A && git commit -m
co = checkout
cb = rev-parse --abbrev-ref HEAD
cob = checkout -b
cl = checkout -
@avanslaars
avanslaars / logger.js
Created February 18, 2017 14:18
Add console.log to plunks for egghead lessons
(function(e){const n=console.log;const o=document.querySelector(e.selector);c(o,{background:e.colors.background,color:e.colors.foreground,fontFamily:"monospace"});function t(e){return{}.toString.call(e)==="[object Array]"}function r(e){return{}.toString.call(e)==="[object Object]"}function l(e){return e&&typeof e.inspect==="function"}function c(e,n){Object.assign(e.style,n);return e}function i(e){const n=document.createElement("span");if(e.tagName){n.appendChild(e)}else{n.innerText=e}return n}function u(n){const o=document.createElement("span");o.appendChild(i("{ "));Object.keys(n).reduce(function(o,t,r,l){o.appendChild(c(i(t+": "),{color:e.colors.key}));o.appendChild(d(n[t]));if(r<l.length-1){o.appendChild(i(", "))}return o},o);o.appendChild(i(" }"));return o}function a(e){const n=document.createElement("span");n.appendChild(i("[ "));e.reduce(function(n,o,t){n.appendChild(d(o));if(t<e.length-1){n.appendChild(i(", "))}return n},n);n.appendChild(i(" ]"));return n}function d(n){if(l(n)){return d(n.inspect())}el
@avanslaars
avanslaars / Mytools.md
Created February 5, 2017 22:36
Temporary Version of My Tools Page while the website is down

As a developer, trainer and screen caster, I rely heavily on my tools to help me accomplish my goals. Between hardware and software I use for development, the tools I use for screen casting and just keeping myself organized, the list of tools in my toolbox is fairly vast.

I've gotten quite a few questions about my Atom setup since my Egghead Course on React was published. So I figured I would start with that and come back and update this with the rest when I find the time.

Atom

I'm a huge fan of the open source Atom editor.

I'm currently using the Atom Material Themes for UI and syntax along with the file icons plugin for my file tree. I also use the minimap plugin with git integration with the minimap-git-diff. That covers the bulk of visble UI elements that people have asked about in my videos.

r.db('demo').table('people')
.eqJoin('id', r.db('demo').table('pets'), {index:'owner_id'})
.group('left')
.pluck('right')
.ungroup()
.map(group => ({
person: group('group'),
pets: group('reduction').map(pet => pet('right'))
}))