Skip to content

Instantly share code, notes, and snippets.

View kimhogeling's full-sized avatar

Kim Hogeling kimhogeling

  • interpersonal GmbH
  • Hamburg
View GitHub Profile
@kimhogeling
kimhogeling / dark_slack.md
Created October 9, 2018 12:59
Dark Theme for Slack

Created by user https://gist.github.com/focus97 :)

Add this code (below) to the bottom of: Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js

document.addEventListener('DOMContentLoaded', function() {

    let tt__customCss = `
        body, .channel_header, #footer, .channel_title_info, #channel_topic_text { background: rgb(0, 43, 54); }
 .c-message__body { color: rgb(153, 174, 177); }
@kimhogeling
kimhogeling / detect_shopping24_widget_click.js
Created September 24, 2018 08:59
Push shopping24 widget click events to Google Tag Manager's dataLayer
// Click listener for tracking clicks on shopping24 products into the Google Tag Manager's DataLayer
document.addEventListener('click', function (event) {
if (!window.dataLayer) {
return;
}
// recursively traverse from a clicked element to detect if the element lives inside a shopping24 product
var s24product = (function findProductNodeByChildNode(potentialProductNode) {
// This guard exists, because anything can happen in the DOM
if (!potentialProductNode) {
@kimhogeling
kimhogeling / hippo.html
Created September 22, 2018 08:59
OTTO coding camp 2018
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
background: grey;
@kimhogeling
kimhogeling / js_optional_chaining_operator.markdown
Last active February 26, 2018 22:31
Why the optional chaining operator might be pretty damn useful for readable code

Coming soon to JavaScript: Optional Chaining Operator

This example is inspired by mpjme's Fun Fun Function Video Watch that! It's short fun and explained really well!

This gist, is for me and my colleagues as a reference.

Given: Optional properties in an object

const hero1 = { name: 'Superman', address: { city: 'Metropolis', zip: 12345 } }
@kimhogeling
kimhogeling / test_helper_for_private_methods.php
Created December 18, 2017 16:14
test helper for private methods
<?php
namespace xxx\Tests;
class Helper
{
public static function invokePrivateMethod(&$object, $methodName, array $parameters = array())
{
$reflection = new \ReflectionClass(get_class($object));
$method = $reflection->getMethod($methodName);
@kimhogeling
kimhogeling / click-test-widget.min.js
Last active March 28, 2018 09:37
script to insert a test widget (minified version)
!function(a,widgetId='183',appId='f371b9ed',searchTerm='Wohnzimmer'){function h(){var l=document.createElement('div');return l.setAttribute('class','s24widget'),l.setAttribute('id','s24widget'),l.setAttribute('data-app-id',appId),l.setAttribute('data-widget-id',widgetId),l.setAttribute('data-search-term',searchTerm),l}function j(){var l=document.createElement('script');return l.src='https://widget.s24.com/js/s24widget.min.js',l}function k(){a.map(l=>l.removeEventListener('click',k)),this.appendChild(h()),this.appendChild(j())}a.map(l=>l.addEventListener('click',k))}(Array.prototype.slice.call(document.querySelectorAll('body *')))
@kimhogeling
kimhogeling / createPromiseWithGuardAndExternalResolver.js
Created June 26, 2017 21:26
Create a promise with a guard and an external resolver for performing some tasks before resolving
/**
* Save some data
*/
const persistData = data => {
// persist the data
};
/**
* Fetch some data, persist it and resolve a promise by given resolve function.
*
@kimhogeling
kimhogeling / obsidian_fixed_menu.css
Last active May 4, 2017 19:25
Fixed menu for audiotheme obsidian theme
/**
* These CSS rules make the menu fixed in audiotheme's obsidian theme (https://demo.audiotheme.com/obsidian/)
* Note that the none-demo page probably does not have a bar above it at the top of the screen,
* which means, that you might need to change the `top: 40px` into `top: 0`.
*/
@media (min-width: 768px) { /* prevent messing up the mobile menu */
#menu-primary-menu {
will-change: transform; /* ensure smooth scrolling */
position: fixed; /* pin the menu bar to the screen */
@kimhogeling
kimhogeling / gutschein.html
Created October 4, 2016 08:22
Gutschein für HvO
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link type="text/css" rel="stylesheet" href="http://fast.fonts.net/cssapi/9ae37901-3db6-48c8-bf48-09b254ecc518.css">
</head>
<body>
<style>
@kimhogeling
kimhogeling / drkimble.zsh-theme
Created August 26, 2016 07:57
my oh-my-zsh theme. took agnosterzak and altered it to my likings
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline