This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------------------------------------------------------------------------- */ | |
// 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --new-window --app=http://example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --new-window --app=http://example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?= 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Name: usefulName | |
Caption: usefulName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$username = $_GET['user'] ?? 'nobody'; | |
// This is equivalent to: | |
// $username = isset($_GET['user']) ? $_GET['user'] : 'nobody'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
echo 1 <=> 2; // returns -1 | |
echo 1 <=> 1; // returns 0 | |
echo 2 <=> 1; // returns 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$touristPrices = array_map(function($price) { | |
return $price*2; | |
}, $localPrices); | |
// or | |
$factor = 2; | |
$touristPrices = array_map(function($price) use($factor) { | |
return $price*$factor; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
interface FileStorage { | |
function save($filename, $contents); | |
function readContents($filename); | |
} | |
class LocalDriveFileStorage implements FileStorage { | |
function save($filename, $contents) { |
OlderNewer