Skip to content

Instantly share code, notes, and snippets.

View mauritslamers's full-sized avatar

Maurits Lamers mauritslamers

  • Den Haag, Netherlands
View GitHub Profile
@mauritslamers
mauritslamers / gist:cb472a0ffd43acbcee2a3066b35bf725
Created July 13, 2017 09:08
NGinx configuration for SocketCluster
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name my.domain.ext;
return 301 https://my.domain.ext$request_uri;
}
@mauritslamers
mauritslamers / tutorial_jackd2_pine64.md
Last active April 19, 2018 17:06
Howto get JackD running on a Pine64 board

As many people have found, the default jackd version that comes with the Pine64 Ubuntu image (which is version 1.9.10) will crash as soon as you start it with a bus error and a message in the kernel log about an aligment problem.

In later versions of jackd this has been solved, but as there is no package, you're currently required to compile it by hand. This is not as difficult as it might sound, but it requires some tinkering in the terminal. Also: make sure that your pine64 board has enough power. If you use a 2.0A rated power supply, the board might crash in the middle of the process (as has happened to me). This tutorial assumes you are working with either the Ubuntu Basic Image, or the Ubuntu Mate image. If you are running a different image, the same process will apply, but you might need to adjust some actions.

SC = {
copy: function (object, deep) {
var ret = object, idx;
// fast paths
if (object) {
if (object.isCopyable) return object.copy(deep);
if (object.clone) return object.clone();
}
@mauritslamers
mauritslamers / install_telescope_lxd.md
Last active January 5, 2017 11:32
install telescope guide on lxd

Deploying a Telescope Nova Application in LXD / Ubuntu 16.04

This is a guide how to install the Telescope Nova Application as a deployed app without using MUP. My own motivation is that I want to fit the deployed app into an existing server infrastructure. While LXD is compatible with Docker, I just wanted to use plain LXD.

As Telescope is not considered a full app, but rather as a framework you can use to build your own app, you need to first develop your own app locally. It is assumed you have a deployable application. It is also assumed you already installed Nginx as the main web server.

$theme.sc-source-list.main-source-list {
background-color: #FFF;
.sc-collection-item.even {
background-color: #F7F7F7;
}
.sc-collection-item.even.sel {
background-color: #608ab9;
}
@mauritslamers
mauritslamers / nginx_socketcluster.conf
Created September 15, 2016 15:17
socketcluster nginx config
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name server.example.com;
return 301 https://server.example.com$request_uri;
}
UserAdmin.menuListDelegate = SC.Controller.create(SC.CollectionViewDelegate, {
// we need to be aware of changes of the selection, in order to let the
// statechart follow correctly
// approach from the SC community: always return the current, but do a send event to see wether we can change
// and let the statechart do the changing
collectionViewSelectionForProposedSelection: function (view, sel) {
SC.info('collectionViewSelectionForProposedSelection');
UserAdmin.statechart.sendEvent("proposedStateChange", sel);
//return sel;
.
./_CodeSignature
./_CodeSignature/CodeDirectory
./_CodeSignature/CodeRequirements
./_CodeSignature/CodeResources
./_CodeSignature/CodeSignature
./contents.txt
./Info.plist
./MacOS
./MacOS/darktable
@mauritslamers
mauritslamers / text_field_view.js
Created February 7, 2016 16:52
this fixes text_field_view scrolling
_shouldScroll: function () {
var t = this.$input()[0],
h = this.get('frame').height,
sh = t.scrollHeight,
sTop = t.scrollTop;
if (sh < h) return false;
else {
if (t.scrollTop + h >= sh) {
return false;
/*
Original:
loc: function(str) {
// NB: This could be implemented as a wrapper to locWithDefault() but
// it would add some overhead to deal with the arguments and adds stack
// frames, so we are keeping the implementation separate.
if (!SC.Locale.currentLocale) { SC.Locale.createCurrentLocale(); }
var localized = SC.Locale.currentLocale.locWithDefault(str);
if (SC.typeOf(localized) !== SC.T_STRING) { localized = str; }