This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { connect } from 'react-redux' | |
import { initLoading, stopLoading } from '@/state/actions/loadingActions.js' | |
import { cacheData } from '@/state/actions/dataActions.js' | |
export default connect((state, props) => { | |
return { | |
data: state.data[props.cache] | |
} | |
})( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data:text/html;base64,CjwhRE9DVFlQRSBodG1sPgo8aHRtbD4KICA8aGVhZD4KICAgIDxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KICAgIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgsaW5pdGlhbC1zY2FsZT0xIj4KICAgIDx0aXRsZT5waWNvc2l0ZTwvdGl0bGU+CiAgICA8bWV0YSBuYW1lPSJkZXNjcmlwdGlvbiIgY29udGVudD0iQSByZWFsbHkgdmVyeSB0aW55IHNpdGUgZ2VuZXJhdG9yLiIgLz4KICAgIDxsaW5rIHJlbD0iaWNvbiIgdHlwZT0iaW1hZ2UvcG5nIiBzaXplcz0iMzJ4MzIiIGhyZWY9Imh0dHBzOi8vZXN0cmF0dG9uYmFpbGV5LmNvbS9mYXZpY29uLnBuZyI+CiAgICA8bGluayByZWw9InN0eWxlc2hlZXQiIHR5cGU9InRleHQvY3NzIiBocmVmPSJodHRwOi8vbG9jYWxob3N0OjgwODAvZGVmYXVsdC5jc3MiPgogICAgPHNjcmlwdCBzcmM9Imh0dHA6Ly9sb2NhbGhvc3Q6ODA4MC9waWNvc2l0ZS5qcz9vcmlnaW49ZXN0cmF0dG9uYmFpbGV5L2Jsb2ciPjwvc2NyaXB0Pgo= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const http = require('http') | |
const { h } = require('preact') | |
const renderToString = require('preact-render-to-string') | |
const html = ` | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name='charset' content='utf8' /> | |
<title>server-sent app</title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hexToRGB (c) { | |
const a = [] | |
const steps = [0, 2, 4] | |
for (let i = 0; i < 3; i++) { | |
a[i] = c.slice(steps[i], steps[i] + 2) | |
} | |
return { | |
r: parseInt(a[0], 16), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function roop (c, a) { | |
function cycle (t) { | |
c() && a(t) | |
return requestAnimationFrame(cycle) | |
} | |
return cycle(performance.now()) | |
} | |
let y = window.pageYOffset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Context = React.createContext({}) | |
class Provider extends React.Component { | |
constructor (props) { | |
super(props) | |
this.state = { | |
foo: 'Hello' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Variables | |
*/ | |
:root { | |
/* colors */ | |
--black: #000; | |
--gray1: #555; | |
--gray2: #aaa; | |
--gray3: #ddd; | |
--white: #fff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class='collection-list no-pad rel'> | |
<div class='outer'> | |
<div class='container'> | |
{% assign lnames = '' %} | |
{% assign letters = '' %} | |
{% for collection in collections %} | |
{% if collection.title contains 'Designer:' %} | |
{% assign name = collection.title | split: ':' | last %} | |
{% assign rname = name | split: "" | reverse | join: "" %} | |
{% assign lrname = rname | split: " " | first %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mitt from 'mitt' | |
class Touchy { | |
constructor (scope) { | |
this.cancel() // add props to object | |
scope.addEventListener('touchstart', this.start.bind(this)) | |
scope.addEventListener('touchmove', this.move.bind(this)) | |
scope.addEventListener('touchend', this.end.bind(this)) | |
scope.addEventListener('touchcancel', this.cancel.bind(this)) |