Skip to content

Instantly share code, notes, and snippets.

View shimaore's full-sized avatar
🏕️

Stéphane Alnet shimaore

🏕️
View GitHub Profile
@shimaore
shimaore / umtrx notes.md
Last active May 12, 2018 14:44
Notes on how to build software and start UmTRXv2 (beta)

Note: I run Debian/testing on amd64 architecture. I use sudo to gain root access.

Prerequisites

sudo apt-get install \
  autoconf libtool libosip2-dev libortp-dev g++ sqlite3 libsqlite3-dev libreadline6-dev libboost-all-dev \
  libusb-1.0.0-dev python-cheetah doxygen docutils \
  libusb-dev libftdi-dev
@shimaore
shimaore / coffeescript-ctags
Created November 28, 2013 13:57
Yet another ctags definition for coffee-script
--langdef=coffee
--langmap=coffee:.coffee
--langmap=coffee:.coffee.md
--regex-coffee=/(^|[ \t])*class ([A-Za-z_][A-Za-z0-9_]*\.)*([A-Za-z_][A-Za-z0-9_]*)/\3/c,class/
--regex-coffee=/(\.|@)([A-Za-z_][A-Za-z0-9_]*):[ \t]*[-=]>/\2/m,method/
--regex-coffee=/([A-Za-z_][A-Za-z0-9_]*)[ \t]*=.*[-=]>/\1/f,function/
--regex-coffee=/([A-Za-z][A-Za-z0-9_]*)[ \t]*[?+*-]?=/\1/v,variable/
--regex-coffee=/@([A-Za-z_][A-Za-z0-9_]*)[ \t]*[?+*-]?=/\1/f,field/
--regex-coffee=/@([A-Za-z_][A-Za-z0-9_]*):/\1/f,static field/
--regex-coffee=/([A-Za-z_][A-Za-z0-9_]*):/\1/f,field/
@shimaore
shimaore / post-commit
Created June 12, 2012 19:59
Allow etckeeper(8) to automatically send notifications on changes.
#!/bin/bash
# Install this file as /etc/.git/hooks/post-commit
# Dependencies: etckeeper git-email
git send-email --from etckeeper --to root --confirm=never --quiet @{1}
Index: spatialite_osm_filter.c
==================================================================
--- spatialite_osm_filter.c
+++ spatialite_osm_filter.c
@@ -252,36 +252,39 @@
sqlite3_column_text (query, 9));
if (first)
{
/* first NODE row */
@shimaore
shimaore / media-relay.diff
Created November 5, 2013 23:14
Adapt media-relay kernel detection to recent Debian format.
--- mediaproxy-2.5.2/media-relay 2013-11-06 00:03:30.069952020 +0100
+++ /usr/bin/media-relay 2013-11-06 00:12:24.970318048 +0100
@@ -20,7 +20,8 @@
IP_FORWARD_FILE = "/proc/sys/net/ipv4/ip_forward"
CONNTRACK_ACCT_FILE = "/proc/sys/net/netfilter/nf_conntrack_acct"
- KERNEL_VERSION_FILE = "/proc/sys/kernel/osrelease"
+ OS_RELEASE_FILE = "/proc/sys/kernel/osrelease"
+ KERNEL_VERSION_FILE = "/proc/sys/kernel/version"
@shimaore
shimaore / test.js
Last active November 16, 2015 12:04
Test Express behavior wrt next() / next('route') / ..
var express = require('express')
var app = express()
var handler = function (req,res,next,where,what) {
console.log(' ' + where + ' === ' + what)
switch(what) {
case 'stop':
console.log(' ' + where + ':stop -> (do nothing)')
break
@shimaore
shimaore / wes.coffee
Created June 24, 2012 01:59
Pass CoffeeCup params down to embedded CoffeeScript
require('zappajs') ->
@use 'zappa'
@enable 'default layout'
@get '/': ->
foo = 'bar'
@render 'index', foo: foo, hardcode: { coffee: export_params }
@view index: ->
@scripts = ['/zappa/jquery']
@shimaore
shimaore / express_3.diff
Created June 5, 2012 22:07
express_3 first draft
diff --git a/package.json b/package.json
index 3d90697..665b891 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
"homepage": "http://zappajs.github.com/zappajs/",
"repository": {"type": "git", "url": "git://github.com/zappajs/zappajs.git"},
"dependencies": {
- "express": "2.5.9",
+ "express": "3.0.x",
@@ -280,10 +280,38 @@ zappa.app = (func,disable_io,require_css) ->
if typeof arguments[0] isnt 'object'
render.apply @, arguments
else
for k, v of arguments[0]
render.apply @, [k, v]
+ include: (paths) ->
+
+ _end = res.end
+ _write = res.write
@shimaore
shimaore / noclobber-proper.diff
Created September 20, 2011 07:42
Setting 'noclobber' allows @ to contain the data while the zappa context is passed as an argument. Setting 'dataparam' keeps @ as the context while the data is passed as an argument.
diff -ru mauricemach-zappa-ac57545//src/zappa.coffee zappa-noclobber//src/zappa.coffee
--- mauricemach-zappa-ac57545//src/zappa.coffee 2011-09-17 03:12:51.000000000 +0200
+++ zappa-noclobber//src/zappa.coffee 2011-09-20 10:42:15.000000000 +0200
@@ -285,12 +285,19 @@
names = []
names.push k for k, v of ctx
+ data = [req.query, req.params, req.body]
+
if app.settings['autoimport']