Skip to content

Instantly share code, notes, and snippets.

View jasperkennis's full-sized avatar
💨
CODING

Jasper Kennis jasperkennis

💨
CODING
View GitHub Profile
@jasperkennis
jasperkennis / api-documentation.txt
Last active December 15, 2022 16:30
Fanbace Licenses
yarn licenses v1.22.17
├─ (MIT AND BSD-3-Clause)
│ └─ sha.js@2.4.11
│ ├─ URL: git://github.com/crypto-browserify/sha.js.git
│ ├─ VendorName: Dominic Tarr
│ └─ VendorUrl: https://github.com/crypto-browserify/sha.js
├─ (MIT AND Zlib)
│ └─ pako@1.0.11
│ ├─ URL: https://github.com/nodeca/pako.git
│ └─ VendorUrl: https://github.com/nodeca/pako
{
"eventName": "orderConfirmed or orderShipped",
"customerEmail": "jasper@fanbace.com",
"customerName": "Jasper Kennis",
"orderItems": ["Amazing Tshirt", "Fantastic Bag"],
"artistCustomerServiceEmailAddress": "reach-the-artist@their-mail.com",
"orderRef": "abc123",
"orderId": "123455",
"orderUuid": "abc-123-abc-123",
"trackingCode": "theCodeWhenPresent"
@jasperkennis
jasperkennis / index.js
Created November 1, 2021 16:19
Little script to get some stuff Doro needs
/**
* To use:
* - Save this script as `index.js` and put it in a folder
* - In the same folder, put your json file. It MUST be called `dataset.json`.
* - In a terminal go to the folder with the script.
* - Run `node index.js`
* - CSV will be printed with the data you need.
* - If you want to add other data, put it in the array at the beginning of the script.
*/
@jasperkennis
jasperkennis / replace.html
Last active May 26, 2021 07:44
Replace some url params with others
<!-- Place this just before the closing tag of <body> -->
<script>
(function(){
function getParams () {
const paramsToReplace = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
const res = [];
const windowParams = new URLSearchParams(window.location.search);
for (let i = 0; i < paramsToReplace.length; i++) {
const paramName = paramsToReplace[i];
### Keybase proof
I hereby claim:
* I am jasperkennis on github.
* I am jasperkennis (https://keybase.io/jasperkennis) on keybase.
* I have a public key ASBuiYaAZXbxgz1jmfOcd5xdR-jhNXo1LGJkvNJnZzGNMAo
To claim this, I am signing this object:
@jasperkennis
jasperkennis / single-range-slider.js
Last active March 25, 2019 20:26
Single range slider for Slgolia
/**
* Custom implementation of range slider, with a single slider instead of two.
* Defaults min to 0, and allows the max to be changed using the slider.
*
* Implementation depends on jQuery and rangeslider (http://rangeslider.js.org/)
* to be present.
*/
var $,
custom_range_slider,
@jasperkennis
jasperkennis / custom-hierarchical-menu.js
Created September 3, 2018 14:49
Retain open inbetween layers in Algolia Hierarchical menu
/**
* Custom implementation of hierarchical menu that keeps inbetween layers of the
* menu open.
*
* Implementation depends on jQuery being present.
*/
var $,
instantsearch,
instance_header,
@jasperkennis
jasperkennis / calc.php
Created February 19, 2017 12:16
Finding the max value of y
#!/usr/bin/env php
<?php
$points = [
[6.13, 73],
[5.76, 77.7],
[5.39, 78.6]
];
$x1 = $points[0][0];
$x2 = $points[1][0];
# By Oto Brglez - @otobrglez
# Rake task. Put in your (lib/tasks) folder of your Rails application
# Execute with "rake dropbox:backup"
# Configuration must be inside config/dropbox.yml file
namespace :dropbox do
desc "Backup production database to dropbox"
task :backup do
@jasperkennis
jasperkennis / set-cookie.js.coffee
Created October 24, 2012 14:57
Simple function to quickly set a cookie. The function is attached to window so you can call it anywhere once it's loaded.