Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Freelance React / React Native Expert, Cross-platform fanboy (native, web...)

Max Thirouin MoOx

:shipit:
Freelance React / React Native Expert, Cross-platform fanboy (native, web...)
View GitHub Profile
@MoOx
MoOx / __tests__file.js
Created Apr 20, 2017
jest + react-native + error "Something went wrong initializing the native ReactLocalization module"
View __tests__file.js
// now no problem :D
@MoOx
MoOx / index.md
Last active Jan 28, 2018
MacBook Pro Thunderbold 3 / USB-C Dock station list
View index.md

| Name | Henge Docks - Horizontal Docking Station | Henge Docks - Tethered Dock | TS3 Lite CalDigit | TS3 CalDigit | Thunderbolt 3 Express Dock HD | Plugable TB3 | Elgato TB 3 Dock | OWC Thunderbolt 3 Dock | |----------------|--

View gist:b15f3d32a1ed8a1197efac12b02b3db2
export const BOTTOM_LEFT = `
┌──────────────┐
│ │
├──────┐ │
│■■■■■■│ │
│■■■■■■│ │
└──────┴───────┘
`
@MoOx
MoOx / Stylable.js
Created Oct 21, 2016
Stylable component that works well with React inline styles
View Stylable.js
// @flow
import React from "react"
import Hoverable from "../../modules/Hoverable"
import Focusable from "../../modules/Focusable"
import Touchable from "../../modules/Touchable"
type PropsType = {
children?: React$Element<any>,
View webpack.config.babel.js
import path from "path"
import webpack from "webpack"
import ExtractTextPlugin from "extract-text-webpack-plugin"
import { phenomicLoader } from "phenomic"
import PhenomicLoaderFeedWebpackPlugin
from "phenomic/lib/loader-feed-webpack-plugin"
import pkg from "./package.json"
View markdown-no-heading-anchor.js
import remark from "remark"
import slug from "remark-slug"
import autoLinkHeadings from "remark-autolink-headings"
import highlight from "remark-highlight.js"
import toc from "remark-toc"
import html from "remark-html"
function mdify(text) {
return remark()
// https://github.com/wooorm/remark-slug
@MoOx
MoOx / Hoverable.js
Created Sep 29, 2016
Hoverable HoC for React components
View Hoverable.js
// @flow
import React, { Component } from "react"
type Props = {
onMouseEnter?: Function | boolean,
onMouseLeave?: Function | boolean,
}
type State = {
@MoOx
MoOx / compo.js
Created Sep 24, 2016
Class method with this and no bind or no fat arrow in render
View compo.js
import React, { Component } from "react"
class Test extends Component {
handleThing = () => {
this.setState({
// ...
})
};
render() {
@MoOx
MoOx / .flowconfig
Created Sep 22, 2016
some flowconfig
View .flowconfig
[version]
0.30.0
[ignore]
.*/.git/.*
.*/node_modules/.*
.*/.nyc_output/.*
.*/__tests__/.*
.*/dist/.*
@MoOx
MoOx / solution1.js
Created Sep 8, 2016
avoid "windows is undefined" error when in node for React component
View solution1.js
import React, { Component } from "react"
import styles from "./index.css"
export default class Hero extends Component {
componentDidMount() {
if (typeof window !== "undefined") {
require("particles.js").particlesJS.load("particles-js", "assets/particles.json", function() {
console.log("callback - particles.js config loaded")