Skip to content

Instantly share code, notes, and snippets.

View frostney's full-sized avatar
🐢

Johannes Stein frostney

🐢
View GitHub Profile
@frostney
frostney / talk.markdown
Last active September 4, 2017 21:16
ReactiveConf 2017 Lightning talk

This is a lightning talk proposal for ReactiveConf 2017: https://reactiveconf.com/

The Curious Case of Monorepos

Monorepos have often stigmatized as bad practice and as such something that should be avoided. Still, big companies like Facebook, AirBnB and Google are actively using monorepos to manage their projects. In the open source world, monorepos have become more popular with Babel being the most prominent example. We'll dive into why monorepos might have this bad reputation and go into where it makes sense to have monorepos, talk about their advantages and their shortcomings. We'll also look into what tooling solutions are available - especially in a JavaScript context.

@frostney
frostney / YoutubePlayer.js
Created May 20, 2017 13:48
Failed experiment of trying to render Youtube iframes as videos for react-vr. Fails because of cross origin iframes :(
import YoutubePlayer from 'youtube-player';
import html2canvas from 'html2canvas';
export default class YoutubeVideoPlayer {
onMediaEvent: ?(any) => void;
videoElement: HTMLVideoElement;
_muted: boolean;
_volume: number;
static supportedFormats: ?Array<string> = ['youtube'];
@frostney
frostney / settings.json
Created April 11, 2017 00:14
VSCode settings
// Place your settings in this file to overwrite the default settings
{
"window.zoomLevel": 1,
"workbench.iconTheme": "vscode-icons",
"editor.fontFamily": "Fira Code",
"editor.fontSize": 14,
"editor.fontLigatures": true,
"editor.tabSize": 2,
"files.trimTrailingWhitespace": true,
"eslint.autoFixOnSave": true,
@frostney
frostney / talk.markdown
Last active September 22, 2016 12:01
ReactiveConf 2016 Lighting talk proposal: React (Native) and the cross platform pipe dream

This is a lighting talk proposal for ReactiveConf 2016: https://reactiveconf.com/

React (Native) and the cross platform pipe dream

Have one codebase, target all the platforms. While we are on the topic on re-using the same codebase, maybe we could even switch out the renderer with what is the fatest for the situation. Use DOM, Canvas or OpenGL whenever needed. This lighting talk will give impulses on how to approach this mantra and what advantages and disadvantages we might run into in the process.

(Content-wise this lighting talk is a shorter version of https://github.com/frostney/talks/blob/master/proposals.md#can-we-stop-using-lowercased-components-now.)

@frostney
frostney / gist:bd1092e27ea3de299458
Created November 7, 2015 00:43
Trying to figure out a way to load directories through webpack programmatically
module.exports = function(folder, regex) {
if (folder == null) {
folder = './';
}
if (regex == null) {
regex = /\.(js|json|jsx)$/;
}
var req = require.context(folder, false, regex);
@frostney
frostney / gist:5577ab66c05bc8ada747
Last active August 29, 2015 14:19
Storypoints Measurement

Motivation

My plan is to create some kind of general storypoint measurements which I can either use in my private or freelance projects, at my current company or both. I want to get away from estimating story points through having a certain feel or relying too much on the experience of previous user stories. The goal is to be able to apply a general pattern to simplify estimation and planning poker. Instead of discussions like "I just feel it's a 3" or trying to find a correlation between the length of a user story and its size, the engineering team (or even managers with programming experience) can categorize the user story (and their tasks).

Storypoints

1 Storypoint: Multiple or a single small surgical modifications
Example: Layout modifications, Typo fixes, micro bug fixes

@frostney
frostney / gist:78c9f6ceb70da39f4107
Last active August 29, 2015 14:18
Event Emitter experiment (<160 characters)
// Originally, I wanted to a simple Node.js Event Emitter-style object in less than 150 characters, but it just wouldn't fit
/*
Couple of thoughts
* The name Emitter shouldn't be changed
* `var` is missing, so it's directly bound to `window` and we're saving characters (Yeah for using a JS bad practice to our advantage)
* While `e` as the property isn't really amazing, it's just there to use as little characters as possible
* Obviously, there is no checking if the events really exist
* With ES6, method shorthands and arrow functions it would be considerably less than 150 characters
@frostney
frostney / mixin.js
Created April 7, 2015 10:15
React mixins with decorators
var ReactMixin = function(...mixins) {
return function(Component) {
mixins.forEach(function(mixin) {
Object.keys(mixin).forEach(function(methodName) {
const methodValue = mixin[methodName];
if (methodName === 'statics') {
Object.keys(mixin.statics).forEach(function(staticProp) {
const staticValue = mixin.statics[staticProp];
@frostney
frostney / gist:9cdc735cc1e26487328e
Created February 23, 2015 21:52
Minimal CommonJS loader
(function(root) {
var modules = {};
var cache = {};
root.require = function(name) {
if (!Object.hasOwnProperty.call(cache, name)) {
var module = {
id: name,
};
@frostney
frostney / gist:e2acfbd98d4a4e9c1024
Created February 15, 2015 00:27
propertyValue: Gets a value from deep/nested objects
var propertyValue = function(obj, key, separator = '.') {
var keyArray = key.split(separator);
var result = obj;
for (var i = 0, j = keyArray.length; i < j; i++) {
(function(name) {
result = result[name];
})(keyArray[i]);
}