Skip to content

Instantly share code, notes, and snippets.

View aweary's full-sized avatar
🌐
doing things and stuff

Brandon Dail aweary

🌐
doing things and stuff
View GitHub Profile
/** @license React v16.2.0
* react-dom.production.min.js
*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/*
Modernizr 3.0.0pre (Custom Build) | MIT
/** @license React v16.0.0
* react-dom.production.min.js
*
* Copyright (c) 2013-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
(function (global, factory) {
var words=["companies","China","healthcare","freedom","mike flynn","prime minister","great","failing","republican","heros","melania","country","media","wrong","uranium","russian", "news","russia","american","dishonest","podesta","democrats","worry","money","bill","hillary", "refugees","trade","them","honest", "parenthood","intel","eric", "lara"];setInterval(function(){var a=Array.prototype.slice.call(document.querySelectorAll("p.TweetTextSize"));a.forEach(function(a){var b=a.innerHTML;words.forEach(function(a){b=b.replace(new RegExp(a,"gi"),"Ryan")}),a.innerHTML=b})},2e3);
@aweary
aweary / git-upstream.sh
Created February 27, 2017 16:30
Add an upstream remote quickly for Github repos
#! /usr/bin/env bash
# Quickly add an upstream remote repo from Github.
git_dir_path=`git rev-parse --show-toplevel`
repo_name=`basename ${git_dir_path}`
echo "Setting upstream to ${1}/${repo_name}"
git remote add upstream https://github.com/"$1"/"$repo_name".git

ECMA262 - TL;DR

A pocket-size summary of the ECMA262 specification

ECMAScript DataTypes and Values

Every value has an associated type. This section exactly defines the possible types. Types are subclassed into ECMAScript language types and specification types.

// @flow
import { h, render } from 'preact'
type AppProps = {
// FIXME! This will cause an error right due to line 16 passing a string. Change
// this from "number" to "string" and the error goes away.
greeting: number,
};
const App = (props: AppProps) => (
import React from "react";
import smileyPng from "../images/718smiley.png";
const items = [];
const Item = ({ imgsrc, content, title }) => (
<li>
<h3>{title}</h3>
<img style={{height: 500}} src={imgsrc} />
<p>{content}</p>

Preact for Electrode

This document outlines the results of an attempt to get Preact working with the Electrode platform. Getting this to work required two minor adjustments to the client archetype and server:

Client

To get Preact working with the client bundle all I had to do was alias react and react-dom to preact-compat

module.exports = function webpackTable(files) {
const buf = []
const defaultColors = {
bold: '\u001b[1m',
yellow: '\u001b[1m\u001b[33m',
red: '\u001b[1m\u001b[31m',
green: '\u001b[1m\u001b[32m',
cyan: '\u001b[1m\u001b[36m',
magenta: '\u001b[1m\u001b[35m'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style media="screen">
body {
font-family: sans-serif;
}
textarea {