Skip to content

Instantly share code, notes, and snippets.

View jarutis's full-sized avatar

Jonas Jarutis jarutis

View GitHub Profile
@ramsunvtech
ramsunvtech / groupBy.js
Created September 25, 2018 15:07
Group By - ES6
function groupBy(list, props) {
return list.reduce((a, b) => {
(a[b[props]] = a[b[props]] || []).push(b);
return a;
}, {});
}
// Usage.
groupBy([{
id: 1,
@wy193777
wy193777 / s3_download_file_progress_bar.py
Last active July 20, 2023 15:52
Show AWS s3 download_file Progress using tqdm
#python3
def hook(t):
def inner(bytes_amount):
t.update(bytes_amount)
return inner
BUCKET_NAME = 'your_s3_bucket_name'
FILE_NAME = 'your_s3_file_name'
s3 = boto3.resource('s3')
@zarzen
zarzen / spacemacs-cpp.md
Last active January 23, 2024 13:06
C++ development environment setup in Spacemacs
@kylemcdonald
kylemcdonald / showarray.py
Created January 3, 2016 08:56
Minimal code for rendering a numpy array as an image in a Jupyter notebook in memory. Borrowed from the Deep Dream notebook.
import PIL.Image
from cStringIO import StringIO
import IPython.display
import numpy as np
def showarray(a, fmt='png'):
a = np.uint8(a)
f = StringIO()
PIL.Image.fromarray(a).save(f, fmt)
IPython.display.display(IPython.display.Image(data=f.getvalue()))
@biovisualize
biovisualize / README.md
Last active April 12, 2023 12:15
direct svg to canvas to png conversion

It seems that Chrome finally found a way to let us convert from svg to canvas to png without the tainted canvas security feature/bug.

@mbostock
mbostock / .block
Last active April 29, 2024 17:15 — forked from jfirebaugh/faithful.js
Kernel Density Estimation
license: gpl-3.0
redirect: https://observablehq.com/@d3/kernel-density-estimation