Skip to content

Instantly share code, notes, and snippets.

View felixebert's full-sized avatar

Felix Ebert felixebert

View GitHub Profile
@felixebert
felixebert / nkf-kontenrahmen.properties
Created June 18, 2013 12:41
NKF Kontenrahmen Nordrhein-Westfalen
01=Immaterielle Vermögensgegenstände
02=Unbebaute Grundstücke und grundstücksgleiche Rechte
03=Bebaute Grundstücke und grundstücksgleiche Rechte
04=Infrastrukturvermögen
05=Bauten auf fremdem Grund und Boden
06=Kunstgegenstände, Kulturdenkmäler
07=Maschinen und technische Anlagen, Fahrzeuge
08=Betriebs- und Geschäftsausstattung
09=Geleistete Anzahlungen, Anlagen imBau
10=Anteile an verbundenen Unternehmen
@felixebert
felixebert / RestTemplateBasicAuth.java
Last active June 23, 2018 10:04
Spring Rest Template with Basic Auth + JSON - e.g. for Wordpress WP JSON API
public class RemoteApi {
protected RestTemplate restTemplate;
public RemoteApi() {
restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(new MappingJackson2HttpMessageConverter());
}
protected HttpHeaders getHttpHeaders() {
HttpHeaders requestHeaders = new HttpHeaders();
@felixebert
felixebert / scan-for-htaccess.sh
Created August 20, 2015 14:20
delete files using find + checksum - e.g. for hacked wordpress sites
#!/bin/sh
files=$(find . -name ".htaccess")
for file in $files; do
md5=`md5sum ${file} | awk '{ print $1 }'`
if [ "aaecfaf864b713ea1b05151222649929" = "$md5" ]; then
rm -f $file
else
echo $file
fi
done
@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
<!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;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
<style type="text/css">
body, html {
margin: 0;
padding: 0;
@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
#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 / 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();
});
@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.) ...