Skip to content

Instantly share code, notes, and snippets.

@a-m-s
a-m-s / Mirror.md
Last active August 29, 2015 14:03
Remote directory syncronization using rsync and lsynd

Description

This is a simple script that will rsync down a directory tree from a remote system, via ssh, and then keep the remote copy in sync with the local copy using lsyncd, as you edit it. In each case, the newest version of the file is always kept. It is intended for cases when editing remotely is too uncomfortable, and git pull/push is too manual.

lsyncd uses inotify to watch folders efficiently, for changes, new files,

@a-m-s
a-m-s / MediaDecoder.java
Last active February 19, 2023 06:54
Android code to extract raw audio from arbitrary media files.
/* MediaDecoder
Author: Andrew Stubbs (based on some examples from the docs)
This class opens a file, reads the first audio channel it finds, and returns raw audio data.
Usage:
MediaDecoder decoder = new MediaDecoder("myfile.m4a");
short[] data;
while ((data = decoder.readShortData()) != null) {