Skip to content

Instantly share code, notes, and snippets.

View EloB's full-sized avatar
🚀
The World Is Mine

Olle Bröms EloB

🚀
The World Is Mine
View GitHub Profile
@EloB
EloB / !dotfiles.md
Last active February 1, 2023 19:51
Installation instructions for my Dotfiles

Dotfiles

Instructions for the dotfile repository on https://github.com/EloB/dotfiles.

Introduction

The dotfiles in this repository are installed using a bare Git repository. This method does not use symlinks (like most other dotfile repositories).

After the installation, all the dotfiles will be physically present in your home folder, yet, you will still have them under full version control.

<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/babel-core/5.6.15/browser-polyfill.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script src="http://unpkg.com/rxjs@6.3.2/bundles/rxjs.umd.js"></script>
</head>
<body>
@EloB
EloB / RxComponent.js
Created September 5, 2017 16:04
React, redux and rxjs example
import { Component, Children } from 'react';
import { ReplaySubject, Subject } from 'rxjs';
class RxComponent extends Component {
state = {
component: null,
};
componentWillMount() {
this.props$.next(this.props);
this.subscription = this.clientMounted$
@EloB
EloB / index.js
Created August 28, 2017 14:40
RxComponent
import { Component, Children } from 'react';
import { ReplaySubject, Subject } from 'rxjs';
class RxComponent extends Component {
state = {
component: null,
};
componentWillMount() {
this.props$.next(this.props);
this.subscription = this.clientMounted$
@EloB
EloB / example.jsx
Last active August 18, 2017 13:31
withHandlers example hoc
class Button extends Component {
handleClick = (event) => {
const { onClick, test } = this.props;
if (onClick) onClick(event, test)
};
render() {
return <button onClick={this.handleClick} />;
}
}
@EloB
EloB / MyComponent.jsx
Created July 31, 2017 13:15
A simple but really powerful abstract Rx React component.
import RxComponent from './RxComponent';
class MyComponent extends RxComponent {
static propTypes = {
// your props type
};
engine() {
const clock$ = Observable.timer(0, 1000);
return this.props$
.combineLatest(
@EloB
EloB / index.js
Created September 7, 2016 09:14
React, React-dom, React-redux, Redux, Recompose
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
@EloB
EloB / index.js
Created July 28, 2016 15:46
React, React-dom, Redux and React-redux
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
@EloB
EloB / index.js
Created June 15, 2016 14:01
Bundle
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {
@EloB
EloB / dist.js
Created May 17, 2016 11:59
Bundle react, react-dom, recompose
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
var queue = [];
var draining = false;
var currentQueue;
var queueIndex = -1;
function cleanUpNextTick() {