Skip to content

Instantly share code, notes, and snippets.

View design-innovations's full-sized avatar

Jonathan Shroyer design-innovations

View GitHub Profile
@design-innovations
design-innovations / bootstrap-4-sass-mixins-cheat-sheet.scss
Created December 10, 2018 00:05
Bootstrap 4 Sass Mixins [Cheat sheet with examples] #BS4
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// @author http://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/v4-dev/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12 !default;
$grid-gutter-width: 30px !default;
@design-innovations
design-innovations / web-app-mac
Created May 28, 2020 15:24
Make a web-app appear as a regular app - Mac
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --new-window --app=http://example.com
@design-innovations
design-innovations / web-app-pc
Created May 28, 2020 15:25
Make a web-app appear as a regular app - PC
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window --app=http://example.com
@design-innovations
design-innovations / pages-joomla-content-1
Created July 24, 2020 15:07
Pages: Pulling Joomla article example
<?= import('/partials/banner.html') ?>
<? $articles = collection('ext:joomla.model.articles', [
'published' => 1,
'category' => [17, 18, 27, 28, 29, 30, 31, 32, 33, 34],
'sort' => 'title',
]); ?>
<div class="page-width ">
<h2 class="center-me">The following is a full list of all the tools listed alphabetically.</h2>
<div class="twocolumn">
<ul>
Name: usefulName
Caption: usefulName
@design-innovations
design-innovations / php-null_coalescing_operator.php
Last active September 15, 2020 01:04
PHP - Null coalescing operator
<?php
$username = $_GET['user'] ?? 'nobody';
// This is equivalent to:
// $username = isset($_GET['user']) ? $_GET['user'] : 'nobody';
@design-innovations
design-innovations / php-spaceship_operator.php
Last active September 15, 2020 01:03
PHP - Spaceship operator
<?php
echo 1 <=> 2; // returns -1
echo 1 <=> 1; // returns 0
echo 2 <=> 1; // returns 1
@design-innovations
design-innovations / php-generator_function.php
Last active September 15, 2020 01:02
PHP - Generator function
<?php
function xrange($start, $limit, $step = 1) {
for ($i = $start; $i <= $limit; $i += $step) {
yield $i;
}
}
foreach (xrange(1, 9, 2) as $number) {
echo "$number ";
}
// This prints: 1 3 5 7 9
@design-innovations
design-innovations / php-closures.php
Last active September 15, 2020 01:01
PHP - Closures
<?php
$touristPrices = array_map(function($price) {
return $price*2;
}, $localPrices);
// or
$factor = 2;
$touristPrices = array_map(function($price) use($factor) {
return $price*$factor;
@design-innovations
design-innovations / php-interfaces.php
Last active September 15, 2020 01:01
PHP - Interfaces
<?php
interface FileStorage {
function save($filename, $contents);
function readContents($filename);
}
class LocalDriveFileStorage implements FileStorage {
function save($filename, $contents) {