/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$posts = Post::paginate(20);
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
#!/bin/sh | |
# Import a remote database into a local database | |
# ---------------------------------------------- | |
# | |
# Based on http://danherd.net/quick-script-synchronise-from-a-remote-expressionengine-database/ | |
# | |
# Don’t forget chmod +x to make the script executable. | |
# | |
# Change the extension to .command to run the script directly from OS X Finder. |
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
<div class="module__image image--lazy" | |
data-image-src="Tim-Smith_220x140_220_140_int_c1.jpg"></div> |
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
.form-label { | |
@apply .mb-2 .block .text-sm .text-dark; | |
} | |
.form-input, | |
.form-textarea, | |
.form-select { | |
@apply .p-2 .leading-normal .block .w-full .border .text-dark .bg-light .text-sm .font-sans .rounded .text-left .appearance-none; | |
&:focus { |
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 Craft; | |
class Custom_ElementApiHelper | |
{ | |
public static function getParams($params) | |
{ | |
$requestParams = array_filter([ | |
'elementType' => craft()->request->getParam('elementType'), | |
'criteria' => Custom_ElementApiHelper::prepCriteria(craft()->request->getParam('criteria')), |
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
// this is (a start of) an example of a Susy+mq() setup that mimics bootstrap grid. | |
// I work on multiple bootstrap-based projects. | |
// I want to stop using grid classes in the markup, and start using mixins with susy and sass-mq. | |
// Since the project is heavily tied to the bootstrap grid, I want to have the exact same behavior | |
// between bootstrap classes (old code) and susy mixins (new code). | |
// all the grid classes generated below are here to ease up testing. | |
// required: susy + sass-mq |
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 | |
/* | |
* find the n closest locations | |
* @param Model $query eloquent model | |
* @param float $lat latitude of the point of interest | |
* @param float $lng longitude of the point of interest | |
* @param float $max_distance distance in miles or km | |
* @param string $units miles or kilometers | |
* @param Array $fiels to return | |
* @return array |
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
<div v-for="(item, index) in items" v-bind:class="{last : index === (items.length-1)}"> | |
<p>Foo</p> | |
</div> |
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
let cssImport = require('postcss-import') | |
let cssNext = require('postcss-cssnext') | |
let glob = require('glob-all') | |
let mix = require('laravel-mix') | |
let purgeCss = require('purgecss-webpack-plugin') | |
let tailwind = require('tailwindcss') | |
mix.js('resources/assets/js/app.js', 'public/js') | |
.postCss('resources/assets/css/app.css', 'public/css/app.css', [ | |
cssImport(), |
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
{# v2 #} | |
{%- macro ytAddress(url, lazy = true) -%} | |
{% if url is not empty %} | |
{% set id = url|split('v=')|last %} | |
{% set id = id|split('&')|first %} | |
{% set id = id|split('/')|last %} | |
<div class="youtube-player"> | |
<figure style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; margin: 0px;"> | |
<iframe src="https://www.youtube.com/embed/{{id}}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen style="position: absolute; top: 0; left: 0; width: 100%; height: 100%;"{{ lazy ? ' loading="lazy"'}}></iframe> |
OlderNewer