#Scotch.io Tutorial
Original article found here...
The gulp api is incredibly light containing 4 top level functions. They are
- gulp.task
- gulp.src
- gulp.dest
- gulp.watch
//Add new section click | |
$('#sections').on('click', 'button',function() { | |
var sectionNum = $('#sections').children().length + 1; | |
// Create the snippet of html for each section | |
var html = '<div class="block">'; | |
html += '<div class="inline form-group">'; | |
html += '<label>Section ' + sectionNum + '</label>'; | |
html += '<input class="lesson-section" id="section' + sectionNum + '">'; | |
html += '</div>'; | |
html += '<div class="inline form-group">'; |
function drawer(price, cash, cid) { | |
var totalCid = cid.map(function(each) {return each[1];}) | |
.reduce(function(a, b) {return a + b;}); | |
var inDrawer = cid.map(function(each) {return [each[0], getCurrencyTotals(each)];}); | |
var totalDue = cash - price; | |
if(totalDue > totalCid) { |
#Scotch.io Tutorial
Original article found here...
The gulp api is incredibly light containing 4 top level functions. They are
// basic gulpfile.js based on the scotch.io tutorial | |
var gulp = require('gulp'), | |
gulpUtil = require('gulp-util'), | |
jshint = require('gulp-jshint'), | |
sass = require('gulp-sass'), | |
sourcemaps = require('gulp-sourcemaps'), | |
concat = require('gulp-concat'), | |
uglify = require('gulp-uglify'); | |
//My first attempt at creating a gulpfile. | |
//npm install --save-dev gulp gulp-connect gulp-sass gulp-babel babel-preset-react babel-preset-es2015 | |
//run with 'gulp' | |
var gulp = require('gulp'), | |
connect = require('gulp-connect'), | |
babel = require('gulp-babel'), | |
sass = require('gulp-sass'); | |
gulp.task('default', ['babel', 'sass', 'connect', 'watch']); |
/** | |
* Gives you the top 4 values from a range | |
* @param {array} range of numbers to get the top 4 from | |
* @param {number} number of values to return | |
* @return top 4 | |
* @customfunction | |
*/ | |
function GETTOP(gradeRange, topNumber) { | |
var allGrades = gradeRange.reduce(function(a,b) { | |
// flatten the multidimensional array into a single array |
function onOpen() { | |
SpreadsheetApp.getUi() | |
.createAddonMenu() | |
.addItem('KERNView', 'openKernView') | |
.addToUi(); | |
} | |
function onInstall() { | |
onOpen(); | |
} |
I hope this is detailed enough description. If you are questions/comments/suggestions hit me up on twitter @rheajt
function Caesarize(shiftNum) { | |
this.shiftNum = shiftNum; //the number to shift the alphabet | |
} | |
Caesarize.prototype.codify = function(sentence) { | |
var sentenceArr = []; | |
var shiftNum = this.shiftNum; | |
sentence = sentence.toLowerCase(); |