Skip to content

Instantly share code, notes, and snippets.

View Stoltze's full-sized avatar
🦀
Out fishing

Frederik Stoltze Stoltze

🦀
Out fishing
  • Accelerace
  • København K
View GitHub Profile
@Stoltze
Stoltze / genders.json
Created September 22, 2022 08:20
List of 72 genders in json
const genders = [
'Agender',
'Abimegender',
'Adamas gender',
'Aerogender',
'Aesthetigender',
'Affectugender',
'Agenderflux',
'Alexigender',
@Stoltze
Stoltze / PDFViewer.vue
Last active September 20, 2022 20:03
Vue3 (Script Setup) implementation of vue-pdf-embed
<template>
<div class="row pe-0">
<div class="col pe-0">
<vue-pdf-embed
class="border p-0 rounded-3 overflow-hidden"
ref="pdfRef"
:source="source"
:page="page.current"
@rendered="handleDocumentRender"
@Stoltze
Stoltze / jwt.php
Created October 4, 2021 13:53
Vanilla PHP JWT Token Generator for Zoom API
$api_key = '[APY KEY]';
$api_secret = '[API SECRET]';
$expiration = time() + 60; //set to 1 minute, for security reasons
$h_array = [
'alg' => "HS256"
];
$p_array = [
'aud' => null,
@Stoltze
Stoltze / main.php
Created January 12, 2021 08:17
Create a Trello like experience in PHP with Sortable and AJAX
<div class="container-fluid kanban-container">
<div class="row">
<!-- List A -->
<div class="col-12">
<!-- Card -->
<div class="card">
<div class="card-header card-header-flush">
<!-- Title -->
@Stoltze
Stoltze / TimeAgo function
Created June 16, 2020 11:21
A function that shows how long time is has been something. Ie. "4 minutes ago"
function TimeAgo ($oldTime, $newTime) {
$timeCalc = strtotime($newTime) - strtotime($oldTime);
if ($timeCalc >= (60*60*24*30*12*2)){
$timeCalc = intval($timeCalc/60/60/24/30/12) . " years ago";
}else if ($timeCalc >= (60*60*24*30*12)){
$timeCalc = intval($timeCalc/60/60/24/30/12) . " year ago";
}else if ($timeCalc >= (60*60*24*30*2)){
$timeCalc = intval($timeCalc/60/60/24/30) . " months ago";
}else if ($timeCalc >= (60*60*24*30)){
$timeCalc = intval($timeCalc/60/60/24/30) . " month ago";
@Stoltze
Stoltze / tag-manager.php
Created March 29, 2017 07:04
Include Tag Manager in functions.php
<?php
add_action('wp_head', 'add_tag_manager');
function add_tag_manager() { ?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
@Stoltze
Stoltze / bench.php
Created February 24, 2017 08:37
PHP Performance and Speed Benchmark
<?php
/*
##########################################################################
# PHP Benchmark Performance Script #
# © 2010 Code24 BV #
# #
# Author : Alessandro Torrisi #
# Company : Code24 BV, The Netherlands #
# Date : July 31, 2010 #
# version : 1.0 #
@Stoltze
Stoltze / yt-tracking.js
Created February 24, 2017 08:34
YouTube Eventtracking for videos
(function(document, window, config) {
'use strict';
var _config = config || {};
var forceSyntax = _config.forceSyntax || 0;
var dataLayerName = _config.dataLayerName || 'dataLayer';
// Default configuration for events
var eventsFired = {
'Play': true,
@Stoltze
Stoltze / gf_inline_form.php
Last active February 6, 2017 14:21
Inline Form in Gravity Forms (for newsletter sign up)
<!-- Place this code in your functions.php, to enable to function to disable/remove field labels -->
<?php add_filter( 'gform_enable_field_label_visibility_settings', '__return_true' ); ?>
<!-- Place this code in the bottom of page.php -->
<div class="wpb_row vc_row vc_row-fluid mk-fullwidth-true attched-false inline-formular-wrap">
<div class="mk-grid">
<div style="" class="vc_col-sm-12 wpb_column column_container _ height-full">
<div id="text-block-2" class="mk-text-block ">
<h4 style="text-align: center;">
@Stoltze
Stoltze / gravityforms-wpbe-fix.php
Created February 2, 2017 15:02 — forked from bdeleasa/gravityforms-wpbe-fix.php
Wordpress plugin that fixes an issue with WP Better Emails not being able to format Gravity Forms email notifications.
<?php
/**
* Plugin Name: Gravity Forms - WPBE Email Fix
* Plugin URI: https://chooserethink.com
* Description: Fixes an issue with WP Better Emails not being able to format Gravity Forms email notifications.
* Version: 1.0.0
* Author: Brianna Deleasa
* Author URI: http://chooserethink.com
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt