Skip to content

Instantly share code, notes, and snippets.


Maurits Lamers mauritslamers

  • Den Haag, Netherlands
View GitHub Profile
mauritslamers / audacity_rescue.js
Created Dec 5, 2019
audacity rescue script nodejs with stereo support
View audacity_rescue.js
// recover from audacity crash
// usage:
// node audacity_rescue.js [sourcedir] [result_file.wav] [mono|stereo]
// the mono or stereo option is optional, the default is mono.
// Description:
// This script will sort all files on modification date.
// If you create a backup, make sure you use `cp -a` to preserve the modification date
// or create a zip.
View ldd-output_gnucash.node
maurits@maurits-iMac:~/Development/gnucash/bindings/nodejs$ ldd build/Release/gnucash.node (0x00007ffe4777c000) => /home/maurits/Development/gnucash/bindings/nodejs/build/Release/ (0x00007ff84316f000) => /usr/lib/x86_64-linux-gnu/ (0x00007ff842de6000) => /lib/x86_64-linux-gnu/ (0x00007ff8429f5000) => /home/maurits/Development/gnucash/.build/lib/ (0x00007ff8427ad000) => /usr/lib/x86_64-linux-gnu/ (0x00007ff84259c000) => /usr/lib/x86_64-linux-gnu/ (0x00007ff842294000) => /usr/lib/x86_64-linux-gnu/ (0x00007ff841df3000) => /usr/lib/x86_64-linux-gnu/ (0x00007ff841a3c000)
mauritslamers / getter.c
Created Oct 23, 2019
getter for invoice type
View getter.c
gnc_invoice_get_type(InvoiceWindow *iw)
/* uses the same approach as gnc_invoice_get_title */
switch (gncOwnerGetType(&iw->owner))
return iw->is_credit_note ? GNC_INVOICE_CUST_CREDIT_NOTE
mauritslamers / server.js
Last active Nov 25, 2018
socketcluster running at constant 50% CPU
View server.js
This is the SocketCluster master controller file.
It is responsible for bootstrapping the SocketCluster master process.
Be careful when modifying the options object below.
If you plan to run SCC on Kubernetes or another orchestrator at some point
in the future, avoid changing the environment variable names below as
each one has a specific meaning within the SC ecosystem.
var path = require('path');
View custom_proxy.js
var proxyToelating = function (origReq, origResp, next) {
var url = origReq.url;
var path = require('url').parse(url).pathname;
var proxyReq;
console.log("Trying to proxying " + url);
var me = this;
if ( = "";
origReq.headers['Authorization'] = "Basic myauth=";
View express_app.js
app.use('/webdav', proxy('https://my.domain.ext', {
limit: '1gb',
reqBodyEncoding: null,
parseReqBody: false,
proxyReqOptDecorator: function (proxyReqOpts, srcReq) {
proxyReqOpts.headers['Authorization'] = "Basic myencrypedpasswd";
return proxyReqOpts;
View test.scm
(case "|." ;(assoc-ref evt 'whichBar)
( ("|") (assoc-ref brailleMusicSymbols 'normal-bar-line))
( ("|.") (assoc-ref brailleMusicSymbols 'double-bar-end))
( ("||") (assoc-ref brailleMusicSymbols 'double-bar))
( ("!") (assoc-ref brailleMusicSymbols 'dotted-bar-line))
mauritslamers / socketcluster_index.js
Last active Oct 8, 2017
Changes to socketcluster to accomodate loading the worker as ES6 module
View socketcluster_index.js
// One change: expose SCWorker by adding the following line as last line
module.exports.SCWorker = require('./lib/scworker');
View datasource.js
CoreMeetme.DataSource = SC.DataSource.extend({
// we assume there is a connection already before we are asked to retrieve anything
fetch: function (store, query) {
// queries are either allDocs calls or views
// queries carry the database name on which they should be executed
var db = query.get('database');
if (!db && query.get('isRemote')) throw new Error("CoreMeetme: no database on query???");
if (!db && query.get('isLocal')) return true; //don't handle local queries
mauritslamers / overview_controller.js
Created Jul 13, 2017
How to use sproutcore-table
View overview_controller.js
MyApp.overviewController = SC.ArrayController.create(SC.TableDelegate, {