Skip to content

Instantly share code, notes, and snippets.

View MoOx's full-sized 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 / README.md
Last active June 25, 2024 06:17
frontend project Readme example

PROJECT BLAH BLAH

Requirements

For development, you will only need Node.js installed on your environement. And please use the appropriate Editorconfig plugin for your Editor (not mandatory).

Node

Node is really easy to install & now include NPM.

@MoOx
MoOx / __tests__file.js
Created April 20, 2017 13:00
jest + react-native + error "Something went wrong initializing the native ReactLocalization module"
// now no problem :D
@MoOx
MoOx / createElement.js
Last active June 18, 2024 10:23
A tiny helper for document.createElement.
module.exports = function(options) {
var el
, a
, i
if (!options.tagName) {
el = document.createDocumentFragment()
}
else {
el = document.createElement(options.tagName)
if (options.className) {
%reset-Button {
border: none;
margin: 0;
padding: 0;
width: auto;
overflow: visible;
background: transparent;
/* inherit font & color from ancestor */
@MoOx
MoOx / index.js
Last active February 9, 2024 22:44
Export/import github labels
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
@MoOx
MoOx / storage.js
Created May 22, 2014 11:56
Simple localStorage abstraction
var prefix = "storage."
, storage = {
getAll: function() {
var data = {};
for (var key in localStorage){
if (key.indexOf(prefix) === 0) {
data[key.replace(prefix, "")] = storage.getFromLocalStorage(key);
}
}
@MoOx
MoOx / README.md
Last active May 11, 2023 13:59
How to keep in sync your Git repos on GitHub, GitLab & Bitbucket easily
@MoOx
MoOx / README.md
Last active May 5, 2023 12:35
rework vs postcss benchmarks

Rework vs Postcss

❯ node rework.js
rework: parsing/stringify done in 243.85ms (avg on 50 runs)

❯ node postcss.js
postcss: parsing/stringify done in 408.26ms (avg on 50 runs)
@MoOx
MoOx / isDblTouchTap.js
Last active April 30, 2023 19:28
Double touch tap workaround for React based on onTouchTap (react-tap-event-plugin)
const dblTouchTapMaxDelay = 300
let latestTouchTap = {
time: 0,
target: null,
}
export default function isDblTouchTap(event) {
const touchTap = {
time: new Date().getTime(),
target: event.currentTarget,
@MoOx
MoOx / install-flow-windows.md
Last active November 22, 2022 08:59
Unofficial Flow Windows binary