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 / cleanup-svg.js
Last active Apr 18, 2020
Cleanup svg
View cleanup-svg.js
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 Apr 16, 2020
Matrix of existing React ui kit (more than 200 download/week, more than 200 stars)
View react-ui-kit-comparator.md
View gulpfile.js
///
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 / __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 / mailto.js
Last active Dec 20, 2019
a (really) simple way to hide mailto to bots
View mailto.js
;[].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))
})
@MoOx
MoOx / less2stylus.js
Created Aug 27, 2012 — forked from lancejpollard/less2stylus.coffee
Convert LESS to Stylus
View less2stylus.js
// Usage : less2stylusDir('../src/css/');
var fs = require('fs');
// this less 2 stylus conversion script make a stylus easy to read syntax
// - let the braces
// - replace the @ for var as $
// - let semicolons
function less2stylus(less)
@MoOx
MoOx / README.md
Created Sep 19, 2017
Keybase github proof
View README.md

Your username on Github: MoOx Please publicly post the following Gist, and name it keybase.md

Keybase proof

I hereby claim:

  • I am moox on github.
  • I am moox (https://keybase.io/moox) on keybase.
  • I have a public key ASDqDbkch-cnPEc4XlbDhaYbLywxshF_E0wDNfUBz7GLIAo
@MoOx
MoOx / media-queries-width.scss
Created May 30, 2012
predefined sass media queries
View media-queries-width.scss
//
// Predefined Media Queries Mixins
//
// @require sass-3.2 (you need eventually to do "sudo gem install sass --pre")
//
// @author Maxime Thirouin <maxime.thirouin@gmail.com>
//
// @link https://gist.github.com/2028061
// @link http://www.metaltoad.com/blog/simple-device-diagram-responsive-design-planning
@MoOx
MoOx / @react-native-community__netinfo_v4.x.x.js
Last active Jul 25, 2019
react native netinfo flow types (should be on flow-typed but I am too lazy to make tests)
View @react-native-community__netinfo_v4.x.x.js
declare module '@react-native-community/netinfo' {
declare export type StateType =
| 'none'
| 'unknown'
| 'cellular'
| 'wifi'
| 'bluetooth'
| 'ethernet'
| 'wimax'
| 'vpn'
@MoOx
MoOx / autoscroll.js
Last active Jun 21, 2019
Auto scroll to proper active (form) element when keyboard open (may be useless on iOS, but useful on Android)
View autoscroll.js
// auto scroll to proper active (form) element when keyboard open
// may be useless on iOS, but useful on Android
function scrollToActiveElement() {
if (document.activeElement && document.activeElement.scrollIntoViewIfNeeded) {
document.activeElement.scrollIntoViewIfNeeded()
}
}
window.addEventListener("resize", () => {
setTimeout(scrollToActiveElement, 200)
setTimeout(scrollToActiveElement, 1000) // just in case browser is slow