Skip to content

Instantly share code, notes, and snippets.

@tristanwietsma
tristanwietsma / Dockerfile
Created December 9, 2013 05:17
data-science dockerfile
# Python Data Science Environment
#
# VERSION 1.0
# use ubuntu base image from dotCloud
FROM ubuntu
MAINTAINER Tristan Wietsma [email protected]
# update and upgrade repos
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
@caged
caged / d3-server.js
Last active October 17, 2023 04:05
Directly render and serve d3 visualizations from a nodejs server.
// Start `node d3-server.js`
// Then visit http://localhost:1337/
//
var d3 = require('d3'),
http = require('http')
http.createServer(function (req, res) {
// Chrome automatically sends a requests for favicons
// Looks like https://code.google.com/p/chromium/issues/detail?id=39402 isn't
// fixed or this is a regression.
@aaronpk
aaronpk / Makefile
Last active December 20, 2015 10:39
me:
ifeq ($(USER), root)
@echo "\c"
else
@echo "make \c"
endif
a:
ifeq ($(USER), root)
@echo "\c"
Step One
Fetch URL based on column:
'http://www.datasciencetoolkit.org/maps/api/geocode/json?sensor=false&address=' + escape(value, 'url')'
Step Two
Parse Json for longitude:
value.parseJson()["results"][0]["geometry"]["location"]["lng"]
@rufuspollock
rufuspollock / csv2sqlite.py
Last active April 14, 2016 14:22
UPDATED VERSION NOW AT https://github.com/rgrp/csv2sqlite [Script to load CSV to SQLite]
#!/usr/bin/env python
# A simple Python script to convert csv files to sqlite (with type guessing)
#
# @author: Rufus Pollock
# Placed in the Public Domain
import csv
import sqlite3
def convert(filepath_or_fileobj, dbpath, table='data'):
if isinstance(filepath_or_fileobj, basestring):
@wch
wch / examples.r
Created March 6, 2013 20:31
Examples for O'Reilly Webinar on Data Visualization with R and ggplot2
Getting started
===============
# Make sure you have ggplot2 installed
install.packages("ggplot2")
library(ggplot2)
Basic examples
==============
@mbostock
mbostock / .block
Last active August 30, 2025 17:55
Gray Earth
license: gpl-3.0
@erochest
erochest / start-rserve.sh
Created February 17, 2013 23:12
A simple shell script to start Rserve.
#!/bin/sh
R -e 'library(Rserve)' -e 'Rserve(args="--vanilla")'
@aficionado
aficionado / JSON PML schemas.md
Last active September 4, 2018 23:49
JSON PML schemas

JSON PML: schemas for models

  • model-schema.json A generic ML model, containing fields shared by most models despite of their concrete type. It uses:
    • sample-schema.json The schema for dataset sampling specifications
    • field-collection-schema.json Auxiliary schema describing a collection of field (or "properties") descriptors
    • generic-field-schema.json Properties shared by all fields, regardless of their type.
    • field-schema.json The union schema of all field descriptor types, with their specific properties.
  • tree-model-schema.json A specialization of the model schema to decision tree models. It uses:
  • node-schema The schema for the nodes in a decision tree