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
// Requires Modernizr | |
if (!Modernizr.svg || !Modernizr.inlinesvg) | |
{ | |
$('img').each(function() | |
{ | |
this.src = this.src.replace('.svg', '.png'); | |
}); | |
} |
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 | |
exec("convert -version", $response); | |
echo '<h1>ImageMagick</h2>'; | |
echo '<ul>'; | |
foreach ($response as $line) { | |
if (strlen($line)) { | |
echo '<li>' . $line . '</li>'; |
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 | |
/* | |
|-------------------------------------------------------------------------- | |
| How to use | |
|-------------------------------------------------------------------------- | |
| | |
| From the project's root folder, run: | |
| php -S localhost:8000 -t public/ server.php | |
| |
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
curl -sS https://raw.github.com/php-loep/php-loep.github.com/project-website-theme/boilerplate.php | php |
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 | |
namespace ChurchSocial\Middleware; | |
use Closure; | |
class NullMiddleware | |
{ | |
public function handle($request, Closure $next) | |
{ |
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 | |
namespace ChurchSocial\Middleware; | |
use Closure; | |
class TrimMiddleware | |
{ | |
public function handle($request, Closure $next) | |
{ |
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 | |
// Select all tables from the database | |
$tables = DB::select("SELECT tablename FROM pg_catalog.pg_tables WHERE schemaname='public'"); | |
// Get array of just the table names | |
$tables = array_column($tables, 'tablename'); | |
// Loop through and drop each table | |
// The "cascade" option is important otherwise foreign keys constraints will fail |
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
# Clone the Tailwind repo locally | |
git clone git@github.com:tailwindcss/tailwindcss.git tailwind | |
# Go to Tailwind folder | |
cd tailwind | |
# Install Tailwind JS dependencies | |
npm install | |
# Go to docs folder |
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 | |
Collection::macro('treeMap', function ($child, $parent, $callback) { | |
$buildTree = function (array $elements, $parentKey = null) use (&$buildTree, $child, $parent, $callback) { | |
$branch = []; | |
foreach ($elements as $element) { | |
if ($element[$parent] === $parentKey) { | |
$branch[] = $callback($element, $buildTree($elements, $element[$child])); | |
} |
This file has been truncated, but you can view the full file.
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
/* Base */ | |
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ | |
/* Document | |
========================================================================== */ | |
/** | |
* 1. Correct the line height in all browsers. | |
* 2. Prevent adjustments of font size after orientation changes in | |
* IE on Windows Phone and in iOS. | |
*/ | |
html { |