Skip to content

Instantly share code, notes, and snippets.

_randomNum: (max,min=0) ->
return Math.floor(Math.random() * (max - min) + min)
# min is set to 0 by default but a different value can be passed to function
_randomise: ->
randomNum = @_randomNum(10)
# returns a random integer between 0 and 10
@rootical
rootical / browserify_babelify.js
Created March 2, 2015 14:46
Browserify, babel, source maps, gulp, es6, babelify
'use strict';
var gulp = require('gulp');
var browserify = require('browserify');
var babelify = require('babelify');
var source = require('vinyl-source-stream');
gulp.task('browserify', function() {
return browserify({ debug: true })
.transform(babelify)
@rootical
rootical / browserify_watchify_babelify.js
Last active September 23, 2017 16:40
Gulp task example of using Browserify, Watchify, Babelify, Browser Sync, ngAnnoatate with ES6 source maps.
var gulp = require('gulp');
var gulpif = require('gulp-if');
var sourcemaps = require('gulp-sourcemaps');
var util = require('util');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var watchify = require('watchify');
var browserify = require('browserify');
var browserSync = require('browser-sync');
var babelify = require('babelify');
@rootical
rootical / SassMeister-input.scss
Last active October 26, 2015 09:08
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@import "breakpoint";
.parent {
.child {
@include breakpoint(50em) {
margin-bottom: 0;
@rootical
rootical / SassMeister-input.scss
Created October 26, 2015 09:46
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@import "breakpoint";
.parent {
.child {
@include breakpoint(50em) {
margin-bottom: 0;