Skip to content

Instantly share code, notes, and snippets.

View thorstenfriesen's full-sized avatar
🚀
wambo

Thorsten Friesen thorstenfriesen

🚀
wambo
View GitHub Profile
@zaus
zaus / FormRepo.js
Last active January 13, 2023 01:38
Preserve form values across page loads -- i.e. persistent forms. Uses `localStorage` to persist, `jQuery` for utilities.
var FormRepo = function (namespace) {
/// <summary>Persistent form values, saves to localStorage</summary>
/// <param name="namespace" type="String">the namespace to store values in localStorage</param>
// should also protect per page, since we could have the same forms in various places
this.N = namespace + '.' + window.location.pathname;
};
$.extend(FormRepo.prototype, {
namespace: function (key) {
return this.N + '.' + key;
<?php
class SpinningItem{
public function __construct($content){$this->content = $content;}
}
class TextItem extends SpinningItem{}
class OptionsItem extends SpinningItem{}
function parse_spinning_string($string){
if(preg_match_all('/\{((?>[^{}]+)|(?R))*\}/', $string, $matches)){
foreach($matches[0] as $key => $match){
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta type="array">
<langDisable>1</langDisable>
</meta>
<sheets>
<general>
<ROOT type="array">
<TCEforms>
<sheetTitle>Spalten (normal)</sheetTitle>
@jeroenvermeulen
jeroenvermeulen / jv_clean_product_images.php
Last active July 7, 2021 10:21
Script to clean up unused Magento images
#!/usr/bin/env php
<?php
/**
* mh_remove_unused_product_images.php
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
@sergejmueller
sergejmueller / vat_rates.php
Last active February 7, 2021 13:59
List of EU Countries (ISO-3166-2) with equivalent VAT Rates
$vat_rates = array(
'AT' => 20, // Austria
'BE' => 21, // Belgium
'BG' => 20, // Bulgaria
'HR' => 25, // Croatia
'CY' => 19, // Cyprus
'CZ' => 21, // Czech Republic
'DK' => 25, // Denmark
'EE' => 20, // Estonia
'FI' => 24, // Finland
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
@pierre-pretorius
pierre-pretorius / turbolinks_local_storage.js
Last active November 14, 2019 12:56
Store turbolinks cache in window.localStorage