Skip to content

Instantly share code, notes, and snippets.

View TommyKolkman's full-sized avatar

Tommy Kolkman TommyKolkman

View GitHub Profile
<?php
/**
* @desc Loop the primes as suggested by https://www.testingbrain.com/php-tutorial/a-prime-number-list-generation-php-script.html.
* @return array Primes and the sum of the primes up to and including that one.
*/
function getPrimeArray(){
$count = 0 ;
$prime = 2 ;
$table = [];
@TommyKolkman
TommyKolkman / BlockClass.php
Created May 30, 2016 13:23
Add product to cart in Magento 2
public function __construct(
\<Vendor>\<ModuleName>\Helper\HelperName $helperName,
array $data = []
) {
$this->_helperName = $helperName;
}
@TommyKolkman
TommyKolkman / ElephantData.php
Last active April 13, 2016 10:39
Observer to strip <p> tags for Magento 2
<?php
namespace Elephant\CFParent\Helper;
class ElephantData extends \Magento\Framework\App\Helper\AbstractHelper
{
public function __construct(
\Magento\Framework\App\Helper\Context $context,
array $data = []
<?php
/*
Plugin Name: Simple Shibboleth Authentication
Author: Martin Parm
Version: 0.0.1
*/
function custom_login(){
$headers = getallheaders();
// TODO: Bail on no SSO-heaers