Skip to content

Instantly share code, notes, and snippets.

View PereiraM's full-sized avatar

Michael Pereira PereiraM

View GitHub Profile
@PereiraM
PereiraM / README.md
Last active August 29, 2015 14:14 — forked from tnightingale/README.md
_.mixin({
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
CSVtoArray: function( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
_.mixin({
// This will parse a delimited string into an array of
// arrays. The default delimiter is the comma, but this
// can be overriden in the second argument.
CSVtoJSON: function( strData, strDelimiter ){
// Check to see if the delimiter is defined. If not,
// then default to comma.
strDelimiter = (strDelimiter || ",");
// FIX: add an ending carriage return if missing
var gulp = require('gulp');
var clean = require('gulp-clean');
var jshint = require('gulp-jshint');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var imagemin = require('gulp-imagemin');
var bases = {
app: 'app/',
@PereiraM
PereiraM / index.html
Last active August 29, 2015 14:08 — forked from wboykinm/index.html
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Timeout for scrollzoom</title>
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
<link href="//maxcdn.bootstrapcdn.com/bootswatch/3.2.0/darkly/bootstrap.min.css" rel="stylesheet">
<link href='https://api.tiles.mapbox.com/mapbox.js/v2.1.4/mapbox.css' rel='stylesheet' />
<style>
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
#!/usr/bin/env ruby
# coding: UTF-8
# install_phantomjs.rb
#
# download, build, and install PhantomJS for Raspberry Pi
#
# * tested: PhantomJS 1.9.7 / Raspbian (Wheezy)
#
# created on : 2014.02.13
@PereiraM
PereiraM / toronto.js
Last active August 29, 2015 14:07 — forked from repustate/toronto.js
// Load in GeoJSON data
d3.json("/media/js/toronto.json", function(json) {
//Bind data and create one path per GeoJSON feature
svg.select('#paths').selectAll("path")
.data(json.features)
.enter()
.append("path")
.attr("d", path)
.attr("name", function(d) {
@PereiraM
PereiraM / points.js
Last active August 29, 2015 14:07 — forked from repustate/points.js
d3.json('/media/js/points.json', function(err, json) {
svg.select('#points')
.selectAll('circle')
.data(json)
.enter()
.append("circle")
.attr("r",4)
.style('fill-opacity', 0.7)
.style('display', function(d) {
if (d.dd == base_date.getDate() && d.mm == base_date.getMonth()+1) {