Skip to content

Instantly share code, notes, and snippets.

View LukasGrebe's full-sized avatar

Lukas Grebe LukasGrebe

View GitHub Profile
@LukasGrebe
LukasGrebe / data.csv
Last active August 11, 2020 22:42
Vega-Lite quick cross filter from Fri Aug 07 2020
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
1Path,Title,Event,Bot,Session,FirstVisit,Referrer,Referrer scheme,Browser,Screen size,Location,timestamp
/,Lukas Grebe,false,8,10385086,true,,,"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36","960,600,1",US,2020-06-18T18:04:25Z
/,Lukas Grebe,false,0,10387573,true,,,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15","1280,800,2",DE,2020-06-18T19:28:59Z
/,Lukas Grebe,false,0,10410950,true,,,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","1680,1050,1",DE,2020-06-19T07:27:08Z
/cv,Lukas Grebe - CV,false,0,10410950,true,lukas.grebe.me,h,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","1680,1050,1",DE,2020-06-19T07:27:13Z
/,Lukas Grebe,false,0,10599569,true,Google,g,"Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T530) AppleWebKit/537.
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 6.
1Path,Title,Event,Bot,Session,FirstVisit,Referrer,Referrer scheme,Browser,Screen size,Location,timestamp
/,Lukas Grebe,false,8,10385086,true,,,"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.0 Safari/537.36","960,600,1",US,2020-06-18T18:04:25Z
/,Lukas Grebe,false,0,10387573,true,,,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Safari/605.1.15","1280,800,2",DE,2020-06-18T19:28:59Z
/,Lukas Grebe,false,0,10410950,true,,,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","1680,1050,1",DE,2020-06-19T07:27:08Z
/cv,Lukas Grebe - CV,false,0,10410950,true,lukas.grebe.me,h,"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36","1680,1050,1",DE,2020-06-19T07:27:13Z
/,Lukas Grebe,false,0,10599569,true,Google,g,"Mozilla/5.0 (Linux; Android 5.0.2; SAMSUNG SM-T530) AppleWebKit/537.
@LukasGrebe
LukasGrebe / Linked GTM Container Environment.tpl
Created June 5, 2020 08:32
Tag to load an external GTM container with a specific Environment
___TERMS_OF_SERVICE___
By creating or modifying this file you agree to Google Tag Manager's Community
Template Gallery Developer Terms of Service available at
https://developers.google.com/tag-manager/gallery-tos (or such other URL as
Google may provide), as modified from time to time.
___INFO___
@LukasGrebe
LukasGrebe / Clean Chefkoch.user.js
Created January 10, 2019 12:07
Clean Chefkoch
// ==UserScript==
// @name Clean Chefkoch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description remove some elements i never use
// @author Lukas Grebe
// @match https://www.chefkoch.de/rezepte/*
// @grant none
// ==/UserScript==
@LukasGrebe
LukasGrebe / script.js
Last active January 8, 2019 20:26
Filter bda-bund.de architects by Zip and website
$$('.architect-item').filter(
//match first two zip digits, call node.remove() for non matches
(elm)=>["50","51","53"].indexOf(elm.innerText.match(/\s*(\d\d)\d{3,3}\s*\w+/)[1])>0?true:elm.remove()
).map(elm=>elm.querySelector(':not(a[href^="http"])')).forEach(elm=>elm.remove()) // remove elms that dont have an http a node
@LukasGrebe
LukasGrebe / Confluence - Old pages.xml
Created October 26, 2016 08:04
Confluence - Macro of Pages not Modified for 6 months
<ac:structured-macro ac:macro-id="daee8bfc-97a3-4286-b145-ad544b8ace89" ac:name="contentbylabel" ac:schema-version="3">
<ac:parameter ac:name="max">200</ac:parameter>
<ac:parameter ac:name="showSpace">false</ac:parameter>
<ac:parameter ac:name="sort">modified</ac:parameter>
<ac:parameter ac:name="title">Seit 6 Monaten unbearbeitete Seiten</ac:parameter>
<ac:parameter ac:name="excerptType">simple</ac:parameter>
<ac:parameter ac:name="cql">space = "SPACE" and lastmodified &lt;= now('-6m') and type="page"</ac:parameter>
</ac:structured-macro>
@LukasGrebe
LukasGrebe / affiliateLinks.js
Created February 8, 2015 11:29
Create tracked etracker Links
@LukasGrebe
LukasGrebe / sparhandy.de_TotalPrice.js
Last active October 27, 2017 11:21
Extracts Tarif Name, included Data, prices and fees, and creates a simple tab-seperated String to be copied to the keyboard, for further use in any spreadsheed application
copy($$('.filter-content .product-box').map(box=>[
box.querySelector('.product-box-header').innerText.trim(), //Tarif Name
box.innerText.match(/(\d+)\s+GB/)?box.innerText.match(/(\d+)\s+GB/)[1]:0 //{digits} GB Data
].concat(box.querySelector('.product-prices').innerText.match(/\d?.?\d{0,3}\,\d\d/g) //any prices (Device downpayment, monthly fees ect.)
).join("\t") // Tabseperated columns
).join("\n") //join rows by newline
)//copy to clipboard
@LukasGrebe
LukasGrebe / getNavigationTimings.js
Created December 10, 2014 14:55
Function to gather Navigation Timings reverse engeneered from Google Analytics' analytics.js
/**
* Function to gather Navigation Timings
* reverse engeneered from Google Analytics' analytics.js
*
* @param {Object} t The Object into wich the gathered Timings are Saved
* @param {Object} O The Useragent's window object from wich to gather O.performance Timings
* @return {Boolean} Returns True on success
*/
function getNavigationTimings(t, O) {
var b = O.performance || O.webkitPerformance, n = b && b.navigation, b = b && b.timing;
@LukasGrebe
LukasGrebe / KVB QR to json.php
Last active August 29, 2015 14:02
KVB Stationen Parsen
<?php
function table2vehiclesJson($htmlResultTable)
{
$search = array();
$replace = array();
//Enclosing
$search[] = '/<table[^>]+><tr[^>]+>/';$replace[] = '[{';
$search[] = '/<\/tr[^>]*><\/table[^>]*>/';$replace[] = '}]';