Skip to content

Instantly share code, notes, and snippets.

View gavlooth's full-sized avatar

christos chatzifountas gavlooth

  • Greece
View GitHub Profile
@gavlooth
gavlooth / chuncked_line_seq.clj
Last active March 17, 2018 10:55
An improved file-seq reads a file to a lazy sequence of lines and closes the reader after
(ns chunked-line-seq
(:require [clojure.java.io :as io]))
(defn chunked-line-seq [file-name & {:keys [chunck-size] :or {chunck-size 1000}}]
(let [rd (io/reader (io/input-stream (io/file file-name)))
eof&? (atom false)
chunck-lines (fn [ ]
(seq (loop [lines (transient [] ) counter 0]
(if-let [line (.readLine rd)]
@gavlooth
gavlooth / camper-leaderboard.markdown
Created October 28, 2017 07:41
Camper Leaderboard
@gavlooth
gavlooth / index.html
Last active October 28, 2017 05:40
Visualize Data with a ScatterPlot
<div id="chart">
<div id="tooltip" class="tooltip">
<span id="AthleteInfo1">
</span>
<span id="AthleteInfo2">
</span>
@gavlooth
gavlooth / index.html
Created October 28, 2017 05:36
Visualize Data with a HeatMap
<div id="chart">
<div id="tooltip" class="tooltip">
<span id="Date">
</span>
<span id="Temp">
</span>
<span id="Variance">
@gavlooth
gavlooth / index.html
Last active October 28, 2017 05:36
Show National Contiguity with a Force Directed Graph
<div id="graph">
</div>
@gavlooth
gavlooth / index.html
Last active October 28, 2017 06:17
Map Data Across the Globe
<head>
<script src='https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.10.3/babel.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.5/d3.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.9/topojson.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.2.0/zepto.js"></script>
<style>
body {
width: 100%;
@gavlooth
gavlooth / gulpfile.js
Created October 1, 2016 08:30 — forked from plasticbrain/gulpfile.js
gulp.js task to deploy code to remote servers
/*******************************************************************************
* Description:
*
* Gulp file to push changes to remote servers (eg: staging/production)
*
* Usage:
*
* gulp deploy --target
*
* Examples:
Date Open High Low Close Volume Adj Close
2013-11-07 37.96 38.01 37.43 37.50 60437400 37.50
2013-11-06 37.24 38.22 37.06 38.18 88615100 38.18
2013-11-05 35.79 36.71 35.77 36.64 51646300 36.64
2013-11-04 35.59 35.98 35.55 35.94 28060700 35.94
2013-11-01 35.67 35.69 35.39 35.53 40264600 35.53
2013-10-31 35.66 35.69 35.34 35.41 41682300 35.41
2013-10-30 35.53 35.79 35.43 35.54 36997700 35.54
2013-10-29 35.63 35.72 35.26 35.52 31702200 35.52
2013-10-28 35.61 35.73 35.27 35.57 38383600 35.57