Skip to content

Instantly share code, notes, and snippets.

Avatar

Justus Blümer justusbluemer

View GitHub Profile
@justusbluemer
justusbluemer / adcell.js
Created Feb 2, 2021
ADCELL conversion tracking code
View adcell.js
<script type="text/javascript" src="http://www.adcell.de/js/jsadlib.js"></script>
<script type="text/javascript">
Adcell.user.track({
'pid' : '0000',
'eventid' : '0000',
'referenz' : 'ABC_123',
'betrag' : '123.45'
});
</script>
View setCookie.js
function() {
var setCookie = function (cookieName, cookieValue, expirationInMinutes, domain) {
var expirationTime = expirationInMinutes * 60 * 1000;
var date = new Date();
var dateTimeNow = date.getTime();
date.setTime(dateTimeNow + expirationTime);
var expirationTime = date.toUTCString();
document.cookie = cookieName+"="+cookieValue+"; expires="+expirationTime+"; path=/; domain="+domain;
@justusbluemer
justusbluemer / loadJSONFiles.js
Created Dec 2, 2019
Loads files from a directory and parses them as JSON
View loadJSONFiles.js
const fs = require("fs")
;(async function() {
let items = await loadJSONFiles("items/")
console.log(items)
})()
/**
* Loads and parses JSON files from the specified directory
* @param {string} dirname The name of the directory
@justusbluemer
justusbluemer / couchdb-reset-password-macos.md
Last active Jul 16, 2019
How to reset the CouchDB admin password on macOS
View couchdb-reset-password-macos.md

If you want to reset the admin password of your CouchDB database, you just have to edit your configuration file at

/Users/{username}/Library/Preferences/couchdb2-local.ini

and remove the lines immediately after "[admins]". Then, restart CouchDB. Please make sure to create a new admin user for security.

Thanks to Alex Burghardt for his hint at https://github.com/apache/couchdb/issues/1020#issuecomment-352779051

View pager.js
import React, { Component } from 'react'
import { connect } from 'react-redux'
import { withRouter } from 'react-router-dom'
import classNames from 'classnames'
import styles from './Pager.styl'
import queryBuilder from './queryBuilder'
const Page = ({ page, currentPage, onClick }) => {
const diff = Math.abs(page.number - currentPage)
const className = classNames({
@justusbluemer
justusbluemer / gist:91629adc9ceca3323e983b7043b042eb
Created Nov 27, 2018
Link tracking example without data- attributes
View gist:91629adc9ceca3323e983b7043b042eb
<a href="/example" id="link-123">Anchor text</a>
<script>
var linkTrackingData = [
{
id: 'link-123',
dyn_eventaction: '…',
dyn_teasertype: '…',
moduletype: '…',
elementinfo: '…',