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
def data_get(data, path, default=None): | |
""" | |
Retrieves a value from a nested data structure using "dot" notation. | |
This function is designed to work with dictionaries and tuples. | |
Parameters | |
---------- | |
data : dict or tuple or None | |
The data structure from which to retrieve the value. | |
This can be a nested dictionary, tuple, or a combination of both. |
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 App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Request; | |
class DuskConfigOverride | |
{ | |
/** |
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
if (!function_exists('camel_to_title')) { | |
function camel_to_title($string = '') | |
{ | |
// let's create spaces | |
$intermediate = preg_replace('/(?!^)([[:upper:]][[:lower:]]+)/', ' $0', $string); | |
// now upper case words | |
return mb_convert_case($intermediate, MB_CASE_TITLE); | |
} | |
} |
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
@include mobile { | |
.title.is-1 { font-size: $size-1 * 0.7 } | |
.title.is-2 { font-size: $size-2 * 0.7 } | |
.title.is-3 { font-size: $size-3 * 0.7 } | |
.title.is-4 { font-size: $size-4 * 0.7 } | |
.title.is-5 { font-size: $size-5 * 0.7 } | |
.title.is-6 { font-size: $size-6 * 0.7 } | |
} | |
@include tablet { | |
.title.is-1 { font-size: $size-1 * 0.8 } |
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
/* | |
Start Bootstrap style responsive spacer helper | |
Utilities for spacing, text and float | |
*/ | |
$spacer: 1rem !default; | |
$spacers: () !default; | |
$spacers: map-merge(( |
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
if ( $wp_query->post_count == 0 ) { | |
// First post | |
} | |
if( ( $wp_query->current_post +1) == $wp_query->post_count ) { | |
// Last post | |
} | |
// detect first, even in paginated results | |
if( $wp_query->post_count == 0 && !is_paged() ) { |
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 | |
/** | |
* Slugifies a given string prepping it for usage as a URL string. Includes transliteration. Multi-byte ready for UTF-8. | |
* @param str $str Original url | |
* @param str $delimiter Separator to be used between words, default '-' | |
* @param bool $strtolower Keep existing case or convert all to lower, default true | |
* @return str Sluggified string; | |
*/ | |
function slugify($str = '', $delimiter='-', $strtolower = true) { | |
$str = convert_foreign_characters($str); |