Skip to content

Instantly share code, notes, and snippets.

@psaia
psaia / vintage.html
Created December 26, 2015 02:35
Ace's site.
<!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; }
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)]);
}
#!/bin/bash
#
# Requires:
# - gdal_sieve.py
# - ogr2ogr (GDAL)
# - topojson (node.js)
# Grab the relative directory for source file.
SRC_DIR=`dirname $0`
#!/usr/bin/env node
var fs = require('fs');
var path = require('path');
var async = require('async');
var glob = require('glob');
var slugify = require('slugify');
var parseCSV = require('csv-parse');
var rimraf = require('rimraf');
var d3 = require('d3');
import React from 'react';
export default class Path extends React.Component {
constuctor(props) {
super(props);
this.state = {
d: props.d || props.initialD,
fill: props.fill || props.initialFill,
stroke: props.stroke || props.initialStroke,
className: props.className || props.initialClassName,
@psaia
psaia / crimes.php
Created June 7, 2014 01:34
crimes.php
<?php
error_reporting(E_ERROR | E_PARSE);
header('Content-Type: application/json');
class API {
const CACHE_FILE = "./addresses.txt";
private $hash = array();
public $crimes = array();
########################################
# File: /usr/bin/deploy
########################################
#!/bin/sh
REF_NAME=$1
DEPLOY_BRANCH=$2
REMOTE_PROJECT_PATH=$3
REMOTE_SERVER=$4
(function() {
// This will need to change depending on the enviornment.
// Necessary data files should be included here. Don't
// forget the trailing slash.
var DATA_DIR = "/widgets/railroads_and_states/dist/data/";
// This key is kind of weird. It represents the United
// States in total within the data. Saving as a constant
// incase it's changed to something like "Nation", which
mongoose = require 'mongoose'
helpers = require '../libs/helpers'
events = require "../libs/events"
config = require "../config"
async = require "async"
types =
STATUS: "status"
INTRODUCTION: "introduction"
NOTIFICATION: "notification"
#= require underscore
#= require typewriter
$ ->
# Homepage typewriter effect.
typeWriterElement = document.getElementById "looking-for-prompt"
if typeWriterElement
counter = 0
desires = _.shuffle [
"Anyone like craft brews?",