This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@function strip-units($number) { | |
@return $number / ($number * 0 + 1); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getInputParent (el) { | |
const walk = (node) => { | |
if (node.parentNode) { | |
if (node.parentNode.classList.contains('input')) { | |
return node.parentNode; | |
} else { | |
return walk(node.parentNode); | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import RouteLeaveConfirmation from './RouteLeaveConfirmation'; | |
class ExampleComponent extends React.Component { | |
onConfirmRouteWillLeave () { | |
console.log('confirmed'); | |
} | |
onCancelRouteWillLeave () { | |
console.log('cancelled'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// replace map keys with whatever you want | |
// creats classes as .grid-$keyname-$col | |
$breakpoint-widths: (xs: 480px, sm: 768px, md: 992px, lg: 1200px); | |
$grid-columns: 12 | |
// media query mixin | |
@mixin mq($search) { | |
@media (min-width: map-get($breakpoint-widths, $search)){ | |
@content | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var browserify = require('browserify'); | |
var watchify = require('watchify'); | |
var reactify = require('reactify'); | |
var gulp = require('gulp'); | |
var handleErrors = require('../util/handleErrors'); | |
var source = require('vinyl-source-stream'); | |
function scripts(watch) { | |
var bundler, rebundle; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var table = document.getElementById('t'); | |
var tr = table.querySelector('tr'); | |
var th = document.createElement('th'); | |
var clone; | |
var df = document.createDocumentFragment(); | |
for (var i = 0; i < 100; i++) { | |
// Performance tip: clone a node so that you don't reuse createElement() | |
clone = th.cloneNode(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Application.js file | |
var MyApp = new Backbone.Marionette.Application(); | |
MyApp.addRegions({ | |
someRegion: "#some-div" | |
}); | |
MyApp.addInitializer(function(options){ | |
if(options.somethingOrOther) { | |
MyApp.Foo.display(MyApp.someRegion); |