Skip to content

Instantly share code, notes, and snippets.

View Caerbannog's full-sized avatar

Martin d'Allens Caerbannog

View GitHub Profile
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
//"channel": "#monitoring",
//"username": "AWS SNS via Lamda :: DevQa Cloud",
@Caerbannog
Caerbannog / gist:a68c75979f4e9c92b60497bad01ebdc9
Created July 25, 2016 19:04
Google Firebase Database, serialize and unserialize a ServerValue.TIMESTAMP with the same Model
```java
// Model
public class User {
public Object timestamp; // Server time.
...
}
// Example code
public void test() {
@Caerbannog
Caerbannog / csv2sch.py
Created January 4, 2016 10:12
Read a .tsv and import it into multiple kicad sheets
#! /usr/bin/env python2
#-*- coding: utf8 -*-
"""Read a .tsv and import it into multiple kicad sheets."""
import sys, shutil
import csv, re
# CSV columns that will be ignored.
IGNORED_COLUMNS = [ "sheetName", 'Reference', "Designator", "Quantity", "" ]
#!/bin/bash
# Convert AsciiDoc from "Two line titles" to "One line titles"
# http://asciidoctor.org/docs/asciidoc-recommended-practices/#section-titles
set -e
find src -name '*.adoc' |
while read file
do
awk '{
getUrlForCopyPaste: function(a) {
var d =
k.val("readMoreUrl") || q.canonical.get() || b.removeTrackingParam(c.doc("location.href"));
return t.prepareURLForSharing(k.val("publisherKey"), d, "99", a, {
shorten: !1,
tracking: k.val("defaults.transformations.tracking")
})
},
copyPasteCallback: function(a, d) {