Skip to content

Instantly share code, notes, and snippets.

View felixebert's full-sized avatar

Felix Ebert felixebert

View GitHub Profile
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Script to take an Android ADB email dump and process emails to .eml RFC822
* format files. Does not handle attachments/multipart at present.
*
* <em>Notes:</em>

Keybase proof

I hereby claim:

  • I am felixebert on github.
  • I am felixebert (https://keybase.io/felixebert) on keybase.
  • I have a public key whose fingerprint is 0956 7655 0EFE E253 3087 5A39 93B9 C1FB 8FF9 1D4A

To claim this, I am signing this object:

@felixebert
felixebert / large-json-import.cypher
Created April 10, 2017 14:36
Import of large JSON file into neo4j using apoc
CALL apoc.periodic.iterate("
CALL apoc.load.json('file:///Users/f/source/companies.json')
YIELD value UNWIND value.rows AS row RETURN row
", "
MERGE (c:Company {id: row.id})
ON CREATE SET c.id = row.id, c.name = row.name
WITH row
UNWIND row.relatedPersons as item
MERGE (p:Person {id: item.person.id})
ON CREATE SET p.id = item.person.id, p.name = item.person.name
@felixebert
felixebert / app.js
Created August 18, 2016 14:32
Merge and Filter GeoJSON Example
var fs = require('fs');
var files = ['Carl-Peters.geojson']; // alle geojson Dateien
var allWayFeatures = []; // unsere Ziel-Liste mit allen Ways
files.forEach(function (file) { // für jede geojson Datei ...
var content = fs.readFileSync(file, {encoding: 'utf-8'}); // lese Dateiinhalt als Zeichenkette
var geojson = JSON.parse(content); // Umwandlung in JavaScript-Objekt
geojson.features.forEach(function (feature) { // für jedes GeoJSON Feature (way, node, etc.) ...
@felixebert
felixebert / live-templates.js
Created July 14, 2016 20:37
Intellij Live Templates Karma
//dsc
describe('$name$', function () {
$END$
});
//it
it("should $desc$", function() {
$END$
expect();
});
#include
ESP8266WebServer server(80); //creating the server at port 80
void setup() {
Serial.begin(115200);
server.on("/action1", action1);
server.begin();
pinMode(5, OUTPUT);
}
@felixebert
felixebert / nodeapp.sh
Created May 13, 2016 15:22
nodejs forever init-script
#!/bin/bash
### BEGIN INIT INFO
# Provides: nodeapp
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Node App
### END INIT INFO
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style type="text/css">
body, html {
margin: 0;
padding: 0;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>Title</title>
<style type="text/css">
body {
font-size: 17px;
}
@felixebert
felixebert / format-json
Created August 27, 2015 14:31
bash + python script that formats json in your clipboard
pbpaste | python -m json.tool | pbcopy