This is an example of a horizontally grouped bar chart. It allows you to easily see the difference between different series of data.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ColorExt; | |
(function (ColorExt) { | |
var Utils = (function () { | |
function Utils() { | |
} | |
Utils.hsv2rgb = function (h, s, v) { | |
var rgb, i, data = []; | |
if (s === 0) { | |
rgb = [v, v, v]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Source: https://gist.github.com/erikvullings/41be28677574fd484b43e91413a7e45d | |
Preview: https://bl.ocks.org/erikvullings/41be28677574fd484b43e91413a7e45d | |
--> | |
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of a simple scheduler in Elixir | |
# Source code from the book Programming Elixir | |
# See: https://pragprog.com/book/elixir/programming-elixir | |
# | |
# Start iex | |
# $ iex | |
# > c("scheduler.exs") | |
# > Scheduler.run(12, FibSolver, :fib, [38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38]) | |
defmodule Scheduler do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fast Fibonacci implementation (using a Map to cache previous results) | |
# This code comes from a mailing-list post by José Valim. | |
# | |
# Run iex | |
# $ iex | |
# > c("fib_agent.exs") | |
# > { :ok, agent } = FibAgent.start_link() | |
# > IO.puts FibAgent.fib(agent, 38) | |
defmodule FibAgent do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Phoenix, by default, uses a Postgres database, so start one via docker | |
docker pull postgres | |
# Expose it on port 8432 | |
docker run -p 8432:5432 --name hello-postgres -e POSTGRES_PASSWORD=postgres -d postgres | |
# Install Erlang, Elixir, and now Phoenix | |
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez | |
# Create a new Phoenix app | |
mix phx.new hello | |
# Edit config/dev.exs and update your hostname. Add a port (default is 5432, but I've mapped it to 8432) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
version: '2' | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper | |
hostname: zookeeper | |
extra_hosts: | |
- "moby:127.0.0.1" | |
ports: | |
- "2181:2181" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs'; | |
import path from 'path'; | |
/** | |
* Recursively walk a directory asynchronously and obtain all file names (with full path). | |
* | |
* @param dir Folder name you want to recursively process | |
* @param done Callback function, returns all files with full path. | |
* @param filter Optional filter to specify which files to include, | |
* e.g. for json files: (f: string) => /.json$/.test(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert RD (Rijksdriehoek) coordinates to WGS84 and vice versa. | |
* @see https://thomasv.nl/2014/03/rd-naar-gps/ | |
*/ | |
const projectionBetweenRdWgs84 = () => { | |
const x0 = 155000; | |
const y0 = 463000; | |
const f0 = 52.15517440; // f => phi | |
const l0 = 5.38720621; // l => lambda |
OlderNewer