Skip to content

Instantly share code, notes, and snippets.

View adriennn's full-sized avatar

Adrien Vetterli adriennn

View GitHub Profile
@emoruzzi
emoruzzi / README.md
Last active March 29, 2022 20:10 — forked from Neilos/README.md
Bi-directional hierarchical sankey diagram

This is a demonstration of a bi-directional hierarchical sankey diagram produced in javascript, html and css using d3. (Refresh page to generate new random data)

Sankey diagrams represent flows between nodes by varying the thickness of the connecting links.

This diagram was based off of Mike Bostock's sankey diagram, but additionally incorporates bi-directionality into the flow and caters for hierarchical relationships between nodes to allow drill down into the data.

All javascript code to generate the diagram markup is contained in the app.js file, but the underlying calculations are performed using a custom plugin: bihisankey.js.

This version addresses the issue with double clicking. Demo: http://bl.ocks.org/emoruzzi/6f8140c4d903e64ae35dce0c971e488f

@spences10
spences10 / github-cheat-sheet.md
Last active March 22, 2022 17:59
GitHub Cheat Sheet

Useful Git commands

This is just stuff that I have put down that I find I use a lot of the time for my own reference.

Latest changes from repo to your machine

$ git pull
@m3nu
m3nu / cloudflare-update.py
Created January 19, 2016 07:08
Python Cloudflare Dynamic DNS Update script
#!/usr/bin/env python
"""
Update Cloudflare zone entry to current external IP.
Works great with servers on changing IPs or AWS spot instances.
Usage:
python cloudflare_update.py subdomain
@willerce
willerce / jquery.touchwipe.js
Created January 2, 2015 18:46
jQuery Touchwipe Plugin
/**
* jQuery Plugin to obtain touch gestures from iPhone, iPod Touch and iPad, should also work with Android mobile phones (not tested yet!)
* Common usage: wipe images (left and right to show the previous or next image)
*
* @author Andreas Waltl, netCU Internetagentur (http://www.netcu.de)
* @version 1.1.1 (9th December 2010) - fix bug (older IE's had problems)
* @version 1.1 (1st September 2010) - support wipe up and wipe down
* @version 1.0 (15th July 2010)
*/
(function($) {
@miguelmota
miguelmota / randomDate.js
Last active December 21, 2022 16:27
Random date in JavaScript
function randomDate(start, end) {
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()))
}
console.log(randomDate(new Date(2012, 0, 1), new Date()))
@gubi
gubi / fa-bounce.css
Last active September 14, 2023 17:58
Pulse animation for FontAwesome icons
.fa-bounce {
display: inline-block;
position: relative;
-moz-animation: bounce 1s infinite linear;
-o-animation: bounce 1s infinite linear;
-webkit-animation: bounce 1s infinite linear;
animation: bounce 1s infinite linear;
}
@-webkit-keyframes bounce {