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 / SassMeister-input.scss
Created February 12, 2013 06:31
Generated by SassMeister.com, the Sass playground.
// ---
// Sass (v3.2.9)
// ---
$color-one: red;
$color-two: blue;
@mixin color($prefix, $colors) {
@each $color in $colors {
@MoOx
MoOx / index.html
Last active December 13, 2015 16:58
My nano modernizr
<html class="no-js no-touch">
<script>(function(docEl) {
docEl.className = docEl.className.replace(/\bno-js\b/, 'js');
if ('ontouchstart' in docEl) { docEl.className = docEl.className.replace(/\bno-touch\b/, 'touch'); }
})(document.documentElement);</script>
<!-- <link stylsheet />
<body>
<script> -->
</html>
@MoOx
MoOx / _flex-media.scss
Created February 21, 2013 07:34
Flex media with Sass
$flex-media-selector: false !default; // false: @extend will be used (or include if extend is not appropriate);
$flex-media-default-ratio: 1 !default;
$flex-media-ratios: "16-9" 16/9, "4-3" 4/3, "1-1" 1 !default;
$flex-media-selector-prefix: ".flex-media--" !default;
$flex-media-class: ".flex-media__item" !default;
$flex-media-overflow: hidden !default;
$flex-media-unknown-suffix: "unknown" !default;
// requirements
@mixin flex-media-requirements(
<!doctype html>
<!-- require livereload -->
<link rel="stylesheet" href="index.css"></script>
<!-- require templates/* -->
<script src="index.js"></script>
/* Templates Rules (using Sass placeholders) */
%template-name
%template-name--modifier-name
%template-name__sub-object
%template-name__sub-object--modifier-name
/* Component Rules */
.component-name
.component-name--modifier-name
.component-name__sub-object
@MoOx
MoOx / Gruntfile.js
Last active December 14, 2015 21:38
Grunt.js: Concat or Uglify depending on the ENV
/*global module:false require:true*/
module.exports = function(grunt) {
"use strict";
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
// set option
grunt.option('env', typeof grunt.option('env') !== 'undefined' ? grunt.option('env') : 'dev');
@MoOx
MoOx / getRealChilds.js
Created March 14, 2013 09:41
get real child nodes
function getRealFirstChild(el){
var firstChild = el.firstChild;
// skip TextNodes
while(firstChild !== null && firstChild.nodeType === 3) {
firstChild = firstChild.nextSibling;
}
return firstChild;
}
function getRealChilds(el){
@MoOx
MoOx / querySelector.js
Created March 25, 2013 06:47
Unfinished querySelector polyfill supposed to work on IE6+
// querySelectorAll polyfill
(function(window){
var document = window.document;
//No need to polyfill
if(document.querySelector) {
return;
}
var polyfill_querySelectorAll = function (element, selector) {
@MoOx
MoOx / comments-trick.json
Last active October 17, 2022 15:00
How to make comment in JSON file
{
"//field": "These 'double quote' 'double quote' are used as comments, because JSON doesnt' allow comment",
"field": {},
"#another-field": "Another comment",
"another-field": {},
"/*stuff": "Be careful to use them when you have full control of the content :)",
"stuff": [],
"bla": "bla"
}