Skip to content

Instantly share code, notes, and snippets.

@dlueth
dlueth / entrans.install
Last active March 2, 2021 21:43
Jetson Nano deinterlacing
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "Script must be run as root" 2>&1
exit 1
fi
BASE=$(pwd)
TEMP="$(mktemp -d -t update.XXXXXXXXXX)"
<figure itemprop="image" itemscope itemtype="http://schema.org/ImageObject">
<meta itemprop="caption" content="Apple - AirPods 2nd Gen. (2019) Stereo Bluetooth Kopfhörer Headset (MV7N2ZM/A) - Weiss" />
<meta itemprop="contentUrl" content="https://www.apfelkiste.ch/media/catalog/product/a/p/apple-airpods-2nd-gen-2019-stereo-bluetooth-kopfhorer-mv7n2zm-a5.jpg" />
<div></div>
</figure>
@dlueth
dlueth / init
Last active June 20, 2019 07:33
#!/bin/sh
set -f
log()
{
echo "${1}"
}
log "Checking requirements..."
if [ -n $(which docker) ]; then
@dlueth
dlueth / README.md
Last active March 5, 2020 23:59
SiteSpect Implementation

SiteSpect

What did we test

  • creation of Metrics (which is SiteSpect's name for Campaign/Variation "goals")
  • creation of (Standard) Campaigns
  • creation of Variations
  • creation of Global Variations

All these points are relevant for the requirements of Team Sonic, which are:

@dlueth
dlueth / serviceworker.js
Last active June 20, 2018 15:51
JavaScript: Immediately active Service Worker #JavaScript
self.addEventListener('install', function(event) {
return self.skipWaiting();
});
self.addEventListener('activate', function(event) {
return event.waitUntil(self.clients.claim());
});
@dlueth
dlueth / child.js
Created March 22, 2018 08:26
[React: parent/child reference] #react
class Child extends Component {
static defaultProps = {
onRef: undefined
}
componentDidMount() {
this.props.onRef(this);
}
componentWillUnmount() {
@dlueth
dlueth / async.class.js
Created February 28, 2018 08:54
JavaScript: Async constructor
class MyFirstClass {
constructor() {
return new Promise(async (resolve, reject) => {
try {
resolve(this);
} catch(error) {
reject(error);
}
});
}
@dlueth
dlueth / error.js
Last active March 27, 2018 15:48
NodeJS: Custom errors
'use strict';
class CustomError extends Error {
constructor(...args) {
super(...args);
Object.defineProperty(this, 'name', { value: this.constructor.name });
// This is for Node only...
Error.captureStackTrace(this, this.constructor);
@dlueth
dlueth / slug.php
Created December 9, 2016 13:39
Sluggify in PHP
<?php
class Modify {
private static $instance = NULL;
protected static $mbstring = NULL;
protected static $iconv = NULL;
protected static $characterset = NULL;
/*
protected static $diacritics = array(
'À'=>'A','Á'=>'A','Â'=>'A','Ã'=>'A','Å'=>'A','Ä'=>'A','Æ'=>'AE',
@dlueth
dlueth / demand.module.extended.js
Last active January 2, 2018 15:23
Qoopido.demand: Extended module with configuration settings - see https://github.com/dlueth/qoopido.demand for further details
(function() {
'use strict';
function definition(demand, provide, path, isObject) {
var settings;
function onPostConfigure(options) {
settings = isObject(options) ? options : {};
}