Skip to content

Instantly share code, notes, and snippets.

View seliopou's full-sized avatar
💭
I may be slow to respond.

Spiros Eliopoulos seliopou

💭
I may be slow to respond.
View GitHub Profile
@seliopou
seliopou / GhcAPI.hs
Created November 5, 2012 01:44
Boilerplate module for dynamically compiling, loading, and evaluating Haskell code.
-- Boilerplate module for dynamic compilation, loading, and evaluation of
-- modules using the GHC API, v. 7.4.1. Note that the GHC API is subject to
-- change, so this file may not work for future versions.
--
-- Load and play around with this file using:
--
-- ghci -package ghc -XCPP GhcAPI.hs
--
-- or
--
@seliopou
seliopou / HintExample.hs
Created November 5, 2012 03:06
Boilerplate module for dynamically compiling, loading, and evaluating Haskell code using hint.
-- Boilerplate module for dynamic compilation, loading, and evaluation of
-- modules using hint.
--
-- Load and play around with this file using:
--
-- ghci -package hint HintExample.hs
--
module HintExample where
import Language.Haskell.Interpreter
@seliopou
seliopou / dates.js
Created November 15, 2012 20:01
Render some dates
var dates = [...],
width = ...,
height = ...;
var xscale = d3.scale.linear().domain([0, dates.length]).range([0, width]);
var canvas = d3.select('#canvas')
.append('svg:svg')
.attr('width', width)
.attr('height', height);
@seliopou
seliopou / responsive_d3_example.html
Created November 17, 2012 18:47 — forked from rduplain/responsive_d3_example.html
Responsive d3.js D3 Javascript Histogram Example
<!DOCTYPE html>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style>
body {
font: 10px sans-serif;
}
rect {
@seliopou
seliopou / index.html
Created November 20, 2012 03:12
d3.js animation pattern
<!DOCTYPE html>
<html>
<head>
<title>d3.js animation pattern</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="vis.js"></script>
<style type="text/css">
body {
@seliopou
seliopou / script_tag.html
Created November 20, 2012 20:02
A Conditional Animation Pattern for d3 - script tag
<form>
<input id="back_detect" type="hidden" name="back_detect" value="" />
</form>
<script type="text/javascript">
/* Render vis, animating only if value is set to "" */
vis("#canvas", $("#back_detect").val() == "");
/*
* Set the value of the form field to "visited". Most browsers will
@seliopou
seliopou / index.html
Created November 21, 2012 19:55
d3.js example | circle packing in a rectangle
<!DOCTYPE html>
<html>
<head>
<title>d3.js example | circle packing in a rectangle</title>
<script src="http://d3js.org/d3.v2.js"></script>
<style type="text/css">
</style>
</head>
<body>
<div id="canvas"></div>
@seliopou
seliopou / chart.js
Created December 18, 2012 21:57
A reusable chart combinator for D3.
var chart = (function() {
function copy(o) {
return Object.keys(o).reduce(function(no, k) {
no[k] = o[k];
return no;
}, {});
}
return function(defaults, _cstr) {
return function() {
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>twenty-five suns</title>
<style>
svg {
background: rgb(237, 237, 237);
}
path {
@seliopou
seliopou / _.md
Created February 18, 2013 23:11
orbitals