Skip to content

Instantly share code, notes, and snippets.

View espetro's full-sized avatar
🐴

Quino Terrasa espetro

🐴
View GitHub Profile
@espetro
espetro / index.html
Last active March 30, 2017 22:41
Percentage of total load per total weight in a public transport vehicle in Brasil (2016)
<!DOCTYPE html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://dimplejs.org/dist/dimple.v2.0.0.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<img src="https://i.imgur.com/UMeohYH.jpg" alt="Total load / total weight percentage; transport types in Brasil" height="500" width = "500">
</body>
@espetro
espetro / index.html
Last active April 27, 2017 21:15
D3 challenge month: week 1, day 1
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
.bar {
fill: grey;
}
.bar:hover {
@espetro
espetro / bubblechart_es6.js
Last active May 4, 2017 21:30
D3 challenge month: week 1, day 2 - Reusable charts + ES6
const bubbleChart = () => {
let margin = { top: 40, right: 30, bottom: 40, left: 30},
width = 960 - margin.right - margin.left,
height = 960 - margin.top - margin.bottom,
colorCategory = "category",
colRadius = "views";
// # MODIFIES THE selection GIVEN BY .call()
const chart = selection => {
@espetro
espetro / cities.csv
Last active May 13, 2017 18:32
D3 challenge month [2,1]: intro to maps + zooming + ES6
code city country lat lon
ZNZ ZANZIBAR TANZANIA -6.13 39.31
TYO TOKYO JAPAN 35.68 139.76
AKL AUCKLAND NEW ZEALAND -36.85 174.78
BKK BANGKOK THAILAND 13.75 100.48
DEL DELHI INDIA 29.01 77.38
SIN SINGAPORE SINGAPOR 1.36 103.75
BSB BRASILIA BRAZIL -15.67 -47.43
RIO RIO DE JANEIRO BRAZIL -22.90 -43.24
YTO TORONTO CANADA 43.64 -79.40
@espetro
espetro / index.html
Last active July 24, 2017 22:26
Google's Stochastic Matrix on R
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@espetro
espetro / odyssey.R
Created June 4, 2017 12:30
Function composition in R - text mining application
# Using 'Book I', the Odyssey from The Internet Classics Archive
# http://classics.mit.edu/Homer/odyssey.html
needed <- c("tm", "functional")
# install.packages(needed)
sapply(needed, require, character.only = TRUE)
text <- readLines("http://classics.mit.edu/Homer/odyssey.mb.txt")
str(text)
text[198]
@espetro
espetro / .block
Created June 16, 2017 17:17
fresh block
license: mit
@espetro
espetro / LICENSE.md
Last active July 3, 2017 22:27
d3.slopegraph() | reusable slopegraph v3
@espetro
espetro / index.html
Last active October 30, 2020 09:11
JS color interpolation
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Color Interpolator</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>
<body>
Interim steps: <input type="range" id="numsteps" value="10" min="1" max="20" />
<ul id="list">
@espetro
espetro / blog.md
Last active October 2, 2017 19:50
PHP fresh start

PHP is the most widely-known scripting language for server-side applications. Yet still, a lot of people like me have never had the need to learn it. Maybe because it's not that fast, or because it's the granny of server development. Nevertheless, it's a language worth to know. Here, I've curated a list of what you need to learn it, so there you go:

  • A great [course on PHP][1] that shows you the advantages of its easy syntax and included functionalities.
  • Pick up [a project][4] to work on developing your skills.
  • Get your side projects to work in a real-world environment, developing with popular libraries like [Laravel][5] and publishing your versions in [Heroku][6].

There is yet another thing that is not always remembered, and that is code style. Don't bother to write a tremendous application if you are not willing to make it accessible to other developers. There are [multiple books on the topic][2], but I recommend you to bring always a [code style guide][3] with you.

*tip: