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
{# Loop through all items in a list, comma-separate them, but use "and" before the last item | |
e.g. ["apples", "bananas, "carrots] becomes "apples, bananas, and carrots" #} | |
{% macro to_sentence(items) %} | |
{% for item in items %} | |
{# First item #} | |
{% if loop.first %} | |
<span>{{ item }}{% if items|length > 2 %},{% endif %}</span> | |
{% else %} |
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
{ | |
"Dump variable": { | |
"prefix": "pr", | |
"body": [ | |
"echo '<pre>';", | |
"print_r($1);", | |
"echo '</pre>';" | |
] | |
} | |
} |
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 media-breakpoint-only(xs)": { | |
"description": "Bootstrap media query for 'xs' only", | |
"prefix": "=xs", | |
"body": [ | |
"@include media-breakpoint-only(xs) {", | |
"\t$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
for i in *.mp4; | |
do name=`echo "$i" | cut -d'.' -f1` | |
echo "$name" | |
ffmpeg -i "$i" -acodec libvorbis -aq 5 -ac 2 -qmax 25 -threads 2 "${name}.webm" | |
done |
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
body { | |
&:after { | |
content: "< #{map-get($grid-breakpoints, sm)} (xs)"; | |
position: fixed; | |
z-index: 99999; | |
padding: 2px 15px; | |
bottom: 0; | |
left: 0; | |
border-top-right-radius: 5px; | |
background: blue; |
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
.gitignore file | |
To see the file in folder make 'ls a', to modify do 'vi .gitignore file'. Use this file to insert there full pathes and names of folders/files/objects you would not want to commit to the repo. | |
git init | |
To create a new, empty repository in the current directory | |
git status | |
Shows status of current repo | |
git log |
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
/* text */ | |
'my-field-1' => array( | |
'type' => 'text', | |
'label' => __( 'Text Field 1', 'fl-builder' ), | |
), | |
/* textarea */ | |
'my_textarea_field' => array( | |
'type' => 'textarea', |
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 snippet included in wp-config.php (or settings.php). | |
// Including from that location in a separate file is OK as well. | |
<?php | |
// Remove any leading "www." from the host name. | |
$redirect_host = str_replace('www.', '', $_SERVER['HTTP_HOST']); | |
$redirect_path = strtolower(rtrim($_SERVER['REQUEST_URI'])); | |
if (strlen($redirect_path) > 2) { | |
$redirect_path = rtrim($redirect_path, '/'); | |
} |
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 | |
// Add new custom font to Font Family selection in icon box module | |
function zeckart_add_new_icon_set_to_iconbox( ) { | |
$param = WPBMap::getParam( 'vc_icon', 'type' ); | |
$param['value'][__( 'IcoMoon', 'total' )] = 'icomoon'; | |
vc_update_shortcode_param( 'vc_icon', $param ); | |
} | |
add_filter( 'init', 'zeckart_add_new_icon_set_to_iconbox', 40 ); |
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 first function maps shortcodes to their respective resources, | |
* then checks whether those shortcodes exist in the content, | |
* then stores the required resource handles in a custom field. | |
* This way, we aren't running resource-intensive functions on every page load. | |
*/ | |
function check_post_shortcodes($post_id) { | |
// Map conditional shortcodes to their respective resource handle | |
// Remember to manually dequeue resource handles below as well. |
NewerOlder