Skip to content

Instantly share code, notes, and snippets.

View ddewaele's full-sized avatar

Davy De Waele ddewaele

View GitHub Profile
@ddewaele
ddewaele / rake_preview.txt
Created May 19, 2014 07:48
Output from the rake preview command.
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
Configuration from /Users/ddewaele/octopress/octopress/_config.yml
[2014-05-17 11:34:54] INFO WEBrick 1.3.1
[2014-05-17 11:34:54] INFO ruby 1.9.3 (2013-06-27) [x86_64-darwin11.4.2]
[2014-05-17 11:34:54] INFO WEBrick::HTTPServer#start: pid=14603 port=4000
Auto-regenerating enabled: source -> public
[2014-05-17 11:34:54] regeneration: 94 files changed
>>> Change detected at 11:34:54 to: screen.scss
identical public/stylesheets/screen.css
@ddewaele
ddewaele / BufferedReaderExample.java
Created May 21, 2014 09:22
BufferedReaderExample for reading files
package com.mkyong.io;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
public class BufferedReaderExample {
public static void main(String[] args) {

Creating a model

var AlertModel = Backbone.Model.extend({
    urlRoot: '/alerts',
    idAttribute: 'vin',
     defaults: {
        name:"Davy"
    },
    initialize: function() {

console.log("Creating AlertModel");

@ddewaele
ddewaele / outbound-mqtt.xml
Created June 11, 2014 22:03
MQTT outbound channel
<int-mqtt:outbound-channel-adapter id="mqtt-publish"
client-id="vdm-${env}-publish${mqttClientIdSuffix}"
client-factory="clientFactory"
auto-startup="true"
url="tcp://${env}-api.fleetprobe.com:1883"
default-qos="0"
default-retained="true"
default-topic="spring/mqtt/out1" />
@ddewaele
ddewaele / backbone-no-zombies.js
Created July 1, 2014 08:46
Backbone zombies AND inserting views to a page
Backbone.history.start();
Backbone.View.prototype.close = function(){
this.remove();
this.unbind();
if (this.onClose){
this.onClose();
}
}
var moment = require("moment");
var mqtt = require('mqtt')
, client = mqtt.createClient();
var log = console.log;
console.log = function(){
var now = moment(new Date());
var date = now.format("DD/MM/YYYY hh:mm:ss.SSS");
/* Include the software serial port library */
#include <SoftwareSerial.h>
/*
$ ls /dev/tty.*
/dev/tty.Bluetooth-Modem /dev/tty.SerialPort
/dev/tty.Bluetooth-PDA-Sync /dev/tty.SerialPort-1
/dev/tty.HC-06-DevB
@ddewaele
ddewaele / telenet-latency.md
Last active August 29, 2015 14:05
Telnet response times

17u00 - latency. Bad timings

Pinging telenet.be [195.162.197.132] with 32 bytes of data:
Reply from 195.162.197.132: bytes=32 time=720ms TTL=250
Reply from 195.162.197.132: bytes=32 time=625ms TTL=250
Reply from 195.162.197.132: bytes=32 time=631ms TTL=250
Reply from 195.162.197.132: bytes=32 time=794ms TTL=250

18u40 - latency issue fixed

@ddewaele
ddewaele / spring-mqtt-paho-subscriber.txt
Created September 2, 2014 16:22
spring-mqtt-paho-subscriber
2014-09-02 11:05:51
Full thread dump Java HotSpot(TM) 64-Bit Server VM (21.0-b17 mixed mode):
"task-scheduler-10" prio=10 tid=0x00007f1b44201800 nid=0x34ac waiting on condition [0x00007f1aa52d1000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000007fb23a700> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:226)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2082)
at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1090)
@ddewaele
ddewaele / test_run.ino
Created September 4, 2014 15:44
test program. Toggles PCB on/off
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
int ECU_GND_RELAY=12;
int VOLTAGE_TOGGLER=13;