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 zoomScale = [ // [ radius, min points ] | |
[0, 10], | |
[0.9, 10], // 1 | |
[0.7, 10], // 2 | |
[0.6, 10], // 3 | |
[0.5, 10], // 4 | |
[0.4, 9], // 5 | |
[0.3, 8], // 6 | |
[0.13, 3], // 7 | |
[0.09, 3], // 8 |
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 dummyData = [ | |
{ | |
name: 'Hot Pot', | |
images: [ | |
'http://lorempixel.com/400/400/food/1/' | |
] | |
}, | |
{ | |
name: 'Hot Pot 2', | |
images: [ |
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
{ | |
"nouns": [ | |
"Proclamation", | |
"Getting", | |
"ready", | |
"trip", | |
"Will", | |
"American", | |
"I", | |
"President", |
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
// An example of the configured Pagination component. | |
// I've injected the total in the connection on the server side. | |
<Pagination | |
bsSize="small" | |
items={Math.ceil(total / PAGE_COUNT)} | |
activePage={currentPage} | |
onSelect={this.onPageChange('mangosCurrentPage', 'mango', edges)} | |
/> |
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
#!/usr/bin/env node | |
/** | |
* Process the client side application using babelify and browserify. | |
*/ | |
if (!process.env.CLIENT_PATH || !process.env.SERVER_PATH) { | |
throw 'CLIENT_PATH and SERVER_PATH is required.' | |
} |
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 class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body,html { margin: 0; padding: 0; } |
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
mongoose = require 'mongoose' | |
helpers = require '../libs/helpers' | |
events = require "../libs/events" | |
config = require "../config" | |
async = require "async" | |
types = | |
STATUS: "status" | |
INTRODUCTION: "introduction" | |
NOTIFICATION: "notification" |
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
#= require underscore | |
#= require typewriter | |
$ -> | |
# Homepage typewriter effect. | |
typeWriterElement = document.getElementById "looking-for-prompt" | |
if typeWriterElement | |
counter = 0 | |
desires = _.shuffle [ | |
"Anyone like craft brews?", |
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
mongoose = require 'mongoose' | |
helpers = require '../libs/helpers' | |
config = require "../config" | |
gm = require "gm" | |
path = require "path" | |
os = require "os" | |
crypto = require "crypto" | |
fs = require "fs" | |
request = require "request" |
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 convert(path) { | |
var arr = []; | |
var len = path.getTotalLength(); | |
var p; | |
for (var i = 0; i < len; i++) { | |
p = path.getPointAtLength(i); | |
arr.push([parseFloat(p.x), parseFloat(p.y)]); | |
} |