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
getOffset(obj) { | |
var offsetLeft = 0; | |
var offsetTop = 0; | |
do { | |
if (!isNaN(obj.offsetLeft)) { | |
offsetLeft += obj.offsetLeft; | |
} | |
if (!isNaN(obj.offsetTop)) { | |
offsetTop += obj.offsetTop; | |
} |
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
function makeChecker(size=1) { | |
const black = '#000000' | |
const white = '#FFFFFF' | |
const w = canvas.width/size | |
const h = canvas.height/size | |
let yColor = black | |
// let yColor = white | |
for(let y=0; y<h; y++) { |
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
var fs = require('fs') | |
var stream = fs.createReadStream(filePath, {flags: 'r', encoding: 'utf-8'}); | |
var buf = ''; | |
stream.on('data', function(d) { | |
buf += d.toString(); // when data is read, stash it in a string buffer | |
pump(); // then process the buffer | |
}); |
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
var gulp = require('gulp'); | |
var reactify = require('reactify'); | |
var browserify = require('gulp-browserify'); | |
var browserSync = require('browser-sync').create(); | |
var sass = require('gulp-sass'); | |
function swallowError(error){ | |
console.log(error.toString()); | |
this.emit('end'); | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body ng-app="myApp"> | |
<div ng-controller="Ctrl"> |
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<link rel="stylesheet" href="../include/style.css"> | |
</head> | |
<body> | |
<canvas id="canvas" width="400" height="400"></canvas> | |
<script> |
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
<link rel="import" href="../yt-video/yt-search-video.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
:host { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
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 | |
LIVERELOAD_PORT = 35729, | |
lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }), | |
mountFolder = function( connect, dir ) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
module.exports = function( grunt ) { |
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 | |
LIVERELOAD_PORT = 35729, | |
lrSnippet = require('connect-livereload')({ port: LIVERELOAD_PORT }), | |
mountFolder = function( connect, dir ) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
module.exports = function( grunt ) { |
NewerOlder