Skip to content

Instantly share code, notes, and snippets.

View mvdoc's full-sized avatar
🧠

Matteo Visconti di Oleggio Castello mvdoc

🧠
View GitHub Profile
@mvdoc
mvdoc / loadnpy.js
Created July 3, 2024 23:08 — forked from nvictus/loadnpy.js
NumPy binary file parser for javascript
// Client-side parser for .npy files
// See the specification: http://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
var NumpyLoader = (function () {
function asciiDecode(buf) {
return String.fromCharCode.apply(null, new Uint8Array(buf));
}
function readUint16LE(buffer) {
var view = new DataView(buffer);
var val = view.getUint8(0);
#!/bin/bash
### ABOUT: See: http://gist.github.com/366269
### Runs rsync, retrying on errors up to a maximum number of tries.
### On failure script waits for internect connection to come back up by pinging google.com before continuing.
###
### Usage: $ ./rsync-retry.sh source destination
### Example: $ ./rsync-retry.sh [email protected]:~/* ~/destination/path/
###
### INPORTANT: