Skip to content

Instantly share code, notes, and snippets.

View mooror's full-sized avatar
🚀
Working on our web platform

Benjamin mooror

🚀
Working on our web platform
View GitHub Profile
@mooror
mooror / LeftAndMain.php
Created August 27, 2018 01:11
The save method that triggers the green alert box.
<?php
// ...
/**
* Save handler
*
* @param array $data
* @param Form $form
* @return HTTPResponse
<?php
namespace Sitelease\PaypalAutoSeller\Extensions;
use SilverStripe\ORM\DataExtension;
use SilverStripe\ORM\ArrayList;
use SilverStripe\View\ArrayData;
use Sitelease\PaypalAutoSeller\Model\PrivateProduct;
@mooror
mooror / index.php
Last active October 14, 2018 18:24
Proposal for iteratable/non-iteratable abstraction via callbacks (in php)
<?php
class Person {
protected $name;
protected $age;
public function __construct($name, $age){
$this->name = $name;
$this->age = $age;
<?php
//...
public static function generateUniqueID($uniqueID)
{
// Get the products ID and ID length and store them
$prefix = $uniqueID."-";
$prefixLength = strlen($prefix);
// Generate a unique identifier approximatly 23 characters long
// and remove any periods
$identifier = uniqid("", true);
<?php
...
$download = $request->getVar("download") ? true : false;
if ($download) {
// Get the the product file path,name,type, and size
$productFile = $product->FullUpload()->getAbsoluteURL();
$productFileName = $product->FullUpload()->getFilename();
$productFileType = $product->FullUpload()->getMimeType();
$productFileSize = $product->FullUpload()->getAbsoluteSize();
// Update the HTTPResponse object with the proper download headers
@mooror
mooror / Global Settings.scss
Created November 19, 2018 03:36
Global settings file for those who are following along with the "Global Settings" iota CSS Tutorial
// Baseline Settings
$baseline: 7px;
$baseline-x2: $baseline * 2;
$baseline-x3: $baseline * 3;
$baseline-x4: $baseline * 4;
$baseline-x5: $baseline * 5;
$baseline-x6: $baseline * 6;
$baseline-x7: $baseline * 7;
$baseline-x8: $baseline * 8;
@mooror
mooror / _button.scss
Last active November 19, 2018 22:34
Iota Css Example Code - Button component file for those who are following along with the "Button Component" iota CSS Tutorial
// Button Component Settings
$button-padding: $baseline-x2 $baseline-x3;
$button-bgcolor: $color-blue;
$button-bgcolor-hover: darken($color-blue, 10%);
$button-color: $color-white;
$button-radius: 3px;
$button-outline-padding: ($baseline-x2 - 2) ($baseline-x3 - 2);
$button-outline-bgcolor: transparent;
$button-outline-color: $color-blue;
@mooror
mooror / _card.scss
Last active November 19, 2018 22:35
Iota Css Example Code - Card component file for those who are following along with the "Card Component" iota CSS Tutorial
.c-card {
padding: $baseline-x5;
background: rgba($color-white, 0.8);
border-radius: 2px;
box-shadow: 0 1px 2px 0 rgba(28,45,157,0.28);
}
.c-card--light {
background-color: rgba($color-white, 0.5);
}
@mooror
mooror / index.html
Last active November 20, 2018 02:11
Iota Css Example Code - Header HTML for those who are following along with the "Header" iota CSS Tutorial
<!-- ... -->
<!-- Header -->
<header class="u-bgcolor-purple u-color-white u-p-x3">
<div class="o-container o-container--size-small">
<div class="o-media o-media--middle o-media--res">
<div class="o-media__fixed u-text-left u-text-center@sm">
<img src="svg/logo.svg" alt="Logo" class="logo">
</div>
<div class="o-media__fluid u-text-center u-text-right@sm">
<nav>
@mooror
mooror / _link.scss
Created November 20, 2018 00:29
Iota Css Example Code - Link component file for those who are following along with the "Link Component" iota CSS Tutorial