This file contains 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
//get previous position, so hand doesn't jump on route changes | |
var xPos = 0; | |
var yPos = 0; | |
var storePos = function(x,y){ | |
xPos = x; | |
yPos = y; | |
}; | |
var getPos = function(){ |
This file contains 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
// --------------------------------- | |
// Media query breakpoints & mixin | |
// | |
// Usage: | |
// | |
// @include mq("BREAKPOINT_NAME") { //styles } | |
$breakpoints: ( | |
"extra-small" 500px, |
This file contains 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
<!-- Basic setup. Preload none will load vids faster. I've left the src blank so we can dynamically swap videos if needed, but if | |
you want just one video, just add the src here --> | |
<video id="player" autoplay loop preload="none"> | |
<source id="videomp4" src="" type="video/mp4"> | |
<source id="videowebm" src="" type="video/webm"> | |
</video> |
This file contains 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
'use strict'; | |
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var del = require('del'); | |
var uglify = require('gulp-uglify'); | |
var gulpif = require('gulp-if'); | |
var exec = require('child_process').exec; | |
var notify = require('gulp-notify'); |
This file contains 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
angular.module('progApp').factory('canvasState', function (drawService, Shapes) { | |
var clickzone = document.getElementById('clickzone'); | |
var controls = document.getElementById('controls'); | |
function CanvasState(canvas) { | |
this.canvas = canvas; | |
this.width = canvas.width; | |
this.height = canvas.height; | |
this.ctx = canvas.getContext('2d'); |
This file contains 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
'use strict'; | |
/* global async: false */ | |
/** | |
* @ngdoc service | |
* @name progApp.drawService | |
* @description | |
* # drawService | |
* Factory in the progApp. |
This file contains 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
'use strict'; | |
/** | |
* @ngdoc service | |
* @name progApp.overlayService | |
* @description | |
* # overlayService | |
* Factory in the progApp. | |
*/ | |
angular.module('progApp').factory('Overlays', function () { |
This file contains 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
// client | |
import router from 'path/to/isomorphic/router'; | |
import createLocation from 'history/lib/createLocation'; | |
import createBrowserHistory from 'history/lib/createBrowserHistory'; | |
const location = createLocation(document.location.pathname, document.location.search); | |
const history = createBrowserHistory(); | |
router(location, history) | |
.then((reactEl) => { |
This file contains 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
const prefix = require('vendor-prefix') | |
import Tweezer from 'tweezer.js' | |
var transformPrefix = prefix('transform') | |
var linear = function (t, b, c, d) { | |
return c*t/d + b; | |
} | |
module.exports = function (el) { |
This file contains 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
//-------------------------------------------- | |
// Inflation | |
// | |
export const calculateInflation = ( priceArray ) => { | |
/* | |
--let's assume the price rises from 100 to 150 over a span of 42 days. | |
--that's obviously a 50% increase | |
--then look at days in full year: 365/42 = 8.690476 | |
--for the annualization calculation, the 50% is expressed mathematically as 1.50, like this: | |
1.50^8.690476 (that is, taking that number and raising it to 8.69th power) |
OlderNewer