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 / javascript_resources.md
Created January 20, 2014 15:07 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@MoOx
MoOx / createElement.js
Last active December 19, 2021 10:31
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) {
@MoOx
MoOx / gulpfile.js
Last active November 4, 2021 10:19
///
var pkg = require("./package.json")
, rimraf = require("rimraf")
, gulp = require("gulp")
, gutil = require("gulp-util")
, filter = require("gulp-filter")
, plumber = require("gulp-plumber")
, concat = require("gulp-concat")
gulp.task("clean", function() {
@MoOx
MoOx / @react-native-community__netinfo_v4.x.x.js
Last active June 9, 2021 09:05
react native netinfo flow types (should be on flow-typed but I am too lazy to make tests)
declare module '@react-native-community/netinfo' {
declare export type StateType =
| 'none'
| 'unknown'
| 'cellular'
| 'wifi'
| 'bluetooth'
| 'ethernet'
| 'wimax'
| 'vpn'
@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 / cancelable-promise.js
Created August 5, 2016 11:05
Way to have cancelable promise
// @flow
// https://facebook.github.io/react/blog/2015/12/16/ismounted-antipattern.html
export type CancelablePromise = {
promise: Promise<any>,
cancel: Function,
}
export const makeCancelablePromise = (
@MoOx
MoOx / cleanup-svg.js
Last active April 18, 2020 19:12
Cleanup svg
cleanupSvg(svg) {
return [
// some useless stuff for us
// that svgo doesn't remove
/<title>.*<\/title>/gi,
// remove hardcoded dimensions
/ +width="\d+(\.\d+)?(px)?"/gi,
/ +height="\d+(\.\d+)?(px)?"/gi,
@MoOx
MoOx / react-ui-kit-comparator.md
Last active April 16, 2020 20:36
Matrix of existing React ui kit (more than 200 download/week, more than 200 stars)
@MoOx
MoOx / mailto.js
Last active December 20, 2019 06:15
a (really) simple way to hide mailto to bots
;[].forEach.call(document.getElementsByClassName("js-MailTo"), function(el) {
el.setAttribute("href", "mailto:" + el.getAttribute("data-mailto-user") + "@" + (el.getAttribute("data-mailto-domain") || window.location.host))
})