Skip to content

Instantly share code, notes, and snippets.

View davo's full-sized avatar
🏠

Davo Galavotti davo

🏠
View GitHub Profile
@davo
davo / actions.csv
Last active August 29, 2015 14:06
APHEX TWIN SYRO
action cost
London venue hire for planning meeting with international tea £0.00143
Promotion team in Germany £0.00331
Outdoor postering in Italy £0.00066
Refreshments and lunch for promo team album listening in Paris £0.00043
Hotel in Seattle for album playback meeti £0.00049
Postage costs for US radio promotion mailo £0.00304
Packing CD and booklet £0.06192
Website bandwidth costs £0.00204
Venue and equipment costs for London listening event £0.00163
@davo
davo / Preferences.sublime-settings
Created November 12, 2014 19:00
Sublime Text 3
{
"bold_folder_labels": true,
"caret_style": "wide",
"close_windows_when_empty": true,
"color_scheme": "Packages/User/glacier (SL).tmTheme",
"convert_path": "/usr/local/bin/convert",
"detect_slow_plugins": false,
"draw_white_space": "selection",
"ensure_newline_at_eof_on_save": false,
"fade_fold_buttons": true,
@davo
davo / cut-columns.py
Created November 13, 2014 19:59
Filter columns with Python
import csv
with open("original-large-ass-columns-file.csv","rb") as source:
rdr= csv.reader( source, delimiter=';' )
with open("new-file-lightened.csv","wb") as result:
wtr= csv.writer( result )
for r in rdr:
wtr.writerow((r[2], r[5], r[11]) )
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.bar {
fill: steelblue;
}
.bar:hover {
fill: brown;
@davo
davo / README.md
Last active August 29, 2015 14:14 — forked from mbostock/.block
  1. If you haven’t already: brew install ffmpeg gifsicle imagemagick.
  2. Open QuickTime Player.
  3. File > New Screen Recording.
  4. Record.
  5. Save as recording.mov.
  6. mkdir frames
  7. ffmpeg -i recording.mov -r 24 recording-%03d.png
  8. convert recording-001.png palette.gif
  9. convert -dither none -remap palette.gif recording-*.png recording-uncompressed.gif
  10. gifsicle --optimize=3 --delay=4 &lt; recording-uncompressed.gif &gt; recording.gif
@davo
davo / index.html
Created February 13, 2015 20:21
Linea D, Julio por hora
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@davo
davo / index.html
Created February 13, 2015 20:23
Linea D, Junio y Julio 2014
<!DOCTYPE html>
<meta charset="utf-8">
<style>
body {
font: 10px sans-serif;
}
.axis path,
.axis line {
@davo
davo / index.html
Last active August 29, 2015 14:25 — forked from nbremer/README.md
Gooey Effect - Line
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/ >
<title>Gooey effect - Line</title>
<script src="http://d3js.org/d3.v3.min.js"></script>
<!-- jQuery -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
@davo
davo / README.md
Last active August 29, 2015 14:25 — forked from mbostock/.block
Build Your Own Graph!

Click to add nodes! Nodes near the cursor will be linked to the new node.

D3's force layout uses the Barnes–Hut approximation to compute repulsive charge forces between all nodes efficiently. Links are implemented as geometric constraints on top of position Verlet integration, offering greater stability. A virtual spring between each node and the center of the chart prevents nodes from drifting into space.

@davo
davo / README.md
Last active August 29, 2015 14:25 — forked from mbostock/.block
Multi-Foci Force Layout

Click to perturb or drag the nodes!

This example demonstrates the flexibility of D3's force layout. By using position Verlet integration, it is easy to add custom forces to a layout. In this example, the nodes are clustered around four foci using additional forces: the odd nodes are pushed down, the even nodes are pushed up, and a similar bisecting force is applied laterally. These custom forces are based purely on the index of the node, but they could just as easily be derived from properties of data!