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 MoOx

:shipit:
Freelance React / React Native Expert, Cross-platform fanboy (native, web...)
View GitHub Profile
@MoOx
MoOx / plainCSS.css
Last active December 25, 2015 14:49
Does @at-root worth it?
.org-Component {
}
.org-Component-subChild {
}
.org-Component-subChild--modifier {
module.exports = function getThemeConfig(grunt, prop) {
"use strict";
var happyplan = grunt.config.getRaw('happyplan')
, theme = happyplan
, finalValue = grunt.util.namespace.get(theme, grunt.config.getPropString(prop))
, value
, stupidityLimit = 20
, stupidityChecker = 0
{
"theme": {
"default": {}
"foo": {
"parent": "default",
},
"local": {
"parent": "foo",
}
}
@MoOx
MoOx / SassMeister-input.scss
Created June 13, 2013 17:07
Generated by SassMeister.com, the Sass playground.
// ---
// Sass (v3.2.9)
// ---
// Styling elements based on sibling count
// http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/
@mixin adjust-from-sibling-count($max: 10, $property: width) {
$i: 0;
@while ($i < $max) {
@MoOx
MoOx / SassMeister-input.scss
Created June 7, 2013 20:28
Generated by SassMeister.com, the Sass playground.
// ---
// Sass (v3.2.9)
// ---
// Styling elements based on sibling count
// http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/
@mixin adjust-form-siblings-count($max: 10, $property: width) {
$i: 0;
@while ($i < $max) {
@MoOx
MoOx / comments-trick.json
Last active May 29, 2025 15:36
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"
}
@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 / 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 / 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');