Skip to content

Instantly share code, notes, and snippets.

View mxstbr's full-sized avatar
💅
writing JavaScript

Max Stoiber mxstbr

💅
writing JavaScript
View GitHub Profile

We're excited to have you attend one of our workshops! Here's a JavaScript (re)fresher to help you get up-to-speed on some features of the language we'll be using.

Let and Const

JavaScript has always had var:

var name = 'Ryan'
@mxstbr
mxstbr / asyncify.js
Last active March 13, 2018 09:14 — forked from ForbesLindesay/iter.js
A reusable utility to turn a callback-based listener into an async iterable
// @flow
// Turn a callback-based listener into many async iterators without buffering
import { $$asyncIterator } from 'iterall';
type Listener = ((arg: any) => void) => Promise<any>;
const defaultOnError = (err: Error) => {
throw new Error(err);
};
@mxstbr
mxstbr / grab.js
Last active August 21, 2020 18:47 — forked from SirPepe/grab.js
// Benötigt PhantomJS. Benutzung: $ phantomjs grab.js
var page = require('webpage').create();
page.viewportSize = {
width: 10000, // A0: 9933
height: 15000 // A0: 14043
};
page.open('http://localhost/~peter/map/map.html', function(){
setTimeout(function(){
@mxstbr
mxstbr / Field.js
Last active February 23, 2022 07:39 — forked from hungrysquirrel/Field.js
Style Storybook with Styled Components
import React, { PropTypes } from 'react';
import styled from 'styled-components'
const Wrapper = styled.div`
// styles here that used to be for .test
`
const Label = styled.label`
// label styles here
`