Skip to content

Instantly share code, notes, and snippets.

View klein0r's full-sized avatar
🏠
Working on my smart home

Matthias Kleine klein0r

🏠
Working on my smart home
View GitHub Profile
@mam08ixo
mam08ixo / data-upgrade-0.1.67-0.1.68.php
Last active October 30, 2015 22:02 — forked from avoelkl/upgrade-0.1.67-0.1.68.php
SUPEE-6788 variable + block setup script. 1.) Create a new module or extend a current one. 2.) Create a new install or setup script with the variables and blocks which are not whitelisted yet.
<?php
/**
* @category Namespace
* @package Namespace_Module
* @author Anna Völkl
* @author Christoph Aßmann
* @author Fabian Schmengler
*/
/** @var Mage_Core_Model_Resource_Setup $installer */
@tobi-pb
tobi-pb / archive.php
Created November 2, 2015 16:49
Repack Magento Extension after running `tar xfvz extension.tgz`
<?php
require_once 'abstract.php';
//
//
// PLEASE SET EDIT packages.xml and update md5 hashes!
class Mage_Shell_Archive extends Mage_Shell_Abstract
{
@ScreamingDev
ScreamingDev / sendmail
Last active July 12, 2016 19:11
PHP local send mail (/usr/local/bin/sendmail)
#!/usr/bin/php
<?php
$input = file_get_contents('php://stdin');
preg_match('|^To: (.*)|', $input, $matches);
$filename = tempnam('/var/log/mail', date('ymd-his-') . $matches[1] . '.');
file_put_contents($filename, $input);
@upvalue
upvalue / amazon.rb
Last active December 23, 2016 06:01
Amazon affiliate filters for jekyll.
# amazon.rb - amazon affiliate links for jekyll
# assumes that you have a configuration variable called 'amazon_associate_id' with your associate id
# usage: {{ asin | amazon_product_href }}
# returns url of a product
# usage: {{ asin | amazon_image_href: 'M' }}
# returns image of the product, size argument can be S, M, or L, default M
# usage: {{ asin | amazon_product: 'A Product' }}
@sbisbee
sbisbee / firstclass.php
Created December 17, 2010 23:08
First-class functions in PHP.
<?php
/*
* A demonstration of first-class functions in PHP.
* Blog post: http://www.sbisbee.com/blog.php?id=2352301864
*
* By Sam Bisbee <www.sbisbee.com> on 2010-12-17
*/
function makeLouder($fn)
{
@cordoval
cordoval / GroupBy.php
Created October 5, 2011 22:35 — forked from anonymous/GroupBy.php
Grouping filter for Twig.
<?php
namespace BlackRook\TaskBundle\Twig\Extension;
use DateTime,
Twig_Extension,
Twig_Environment,
Twig_TemplateInterface,
Twig_Error_Runtime,
Twig_Filter_Method;
@rfox90
rfox90 / clock.cgi
Created October 19, 2015 02:55
Simple example of an lametric endpoint in perl.
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use JSON;
my $json = JSON->new->pretty->allow_nonref;
my $q = CGI->new;
@raybogman
raybogman / SupportDesk_FixAcl.php
Last active July 6, 2018 19:00
SupportDesk_FixAcl
<?php
/**
* SupportDesk_FixAcl.php v1.1
* SupportDesk (www.supportdesk.nu)
* 10/7/2015
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL:
@roderik
roderik / .travis.yml
Last active January 30, 2020 06:07
Installing Apache with PHP in Travis-CI
language: php
php:
- 5.3
- 5.4
before_script:
- sudo apt-get install apache2
- sudo a2enmod actions
- sudo a2enmod rewrite
@messageagency
messageagency / pconnect.sh
Last active March 30, 2021 21:47
Pantheon DB Connection Script
#!/bin/sh
# exit on any errors:
set -e
if [ $# -lt 1 ]
then
echo "Usage: $0 @pantheon-alias"
exit 1
fi