Skip to content

Instantly share code, notes, and snippets.

View thorstenfriesen's full-sized avatar
🚀
wambo

Thorsten Friesen thorstenfriesen

🚀
wambo
View GitHub Profile
@pierre-pretorius
pierre-pretorius / turbolinks_local_storage.js
Last active November 14, 2019 12:56
Store turbolinks cache in window.localStorage
[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"
@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
@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:
<?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>
<?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){
@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;
@ceckoslab
ceckoslab / gist:4503260
Created January 10, 2013 16:09
Workaround to unbind the event listeners for the agreement checkboxes
<script type="text/javascript">
//<![CDATA[
// submit buttons are not needed when submitting with ajax
$('review_submit').hide();
if ($('update_shipping_method_submit')) {
$('update_shipping_method_submit').hide();
}
<?php if ($this->getUseAjax()):?>
OrderReviewController.prototype._submitOrder = function() {
@DaRaFF
DaRaFF / ubuntu-php-development-environment.md
Last active October 13, 2023 00:16
Ubuntu php development environment

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

@zhouming
zhouming / MY_Session.php
Created September 8, 2012 05:51
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();