Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin d'Allens Caerbannog

View GitHub Profile
View lambda-cloudwatch-slack.js
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 Jul 25, 2016
Google Firebase Database, serialize and unserialize a ServerValue.TIMESTAMP with the same Model
View gist:a68c75979f4e9c92b60497bad01ebdc9
```java
// Model
public class User {
public Object timestamp; // Server time.
...
}
// Example code
public void test() {
@Caerbannog
Caerbannog / csv2sch.py
Created Jan 4, 2016
Read a .tsv and import it into multiple kicad sheets
View csv2sch.py
#! /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", "" ]
View gist:9714617f3879ddcc741d
#!/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 '{
View gist:797520d31f2a49ba1ded
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) {