/**
* Get Menu Items From Location
*
* @param $location : location slug given as key in register_nav_menus
*/
function getMenuItemsFromLocation($location) {
$theme_locations = get_nav_menu_locations();
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
AL : Alabama | |
AK : Alaska | |
AZ : Arizona | |
AR : Arkansas | |
CA : California | |
CO : Colorado | |
CT : Connecticut | |
DE : Delaware | |
DC : District of Columbia | |
FL : Florida |
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/bash | |
if [ $1 = "1" ]; then | |
curl -XPOST -H "Content-type: application/json" -d '{"method":"passthrough", | |
"params": {"deviceId": "DEVICEID", | |
"requestData": "{\"system\":{\"set_relay_state\":{\"state\":1}}}" } | |
}' 'https://eu-wap.tplinkcloud.com?token=TOKEN' | |
else | |
curl -XPOST -H "Content-type: application/json" -d '{"method":"passthrough", | |
"params": {"deviceId": "DEVICEID", | |
"requestData": "{\"system\":{\"set_relay_state\":{\"state\":0}}}" } |
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
<head> | |
<?php if (is_single() || is_page()) { ?> | |
<meta name="description" content="<?php $s = trim(str_replace("\r\n", " ", htmlspecialchars(strip_tags($post->post_content)))); if(mb_strlen($s,'UTF-8') > 200){$postdescr = mb_substr($s,0,198,'UTF-8').' …';} else{$postdescr = $s;}; echo $postdescr; ?>" /> | |
<meta property="og:description" content="<?php echo $postdescr; ?>" /> | |
<meta property="og:url" content="http://site.com/<?php global $post; echo $post->post_name; ?>" /> <!-- OR --> | |
<meta property="og:url" content="<?php the_permalink() ?>" /> | |
<meta property="og:title" content="Site Name<?php wp_title(); ?>" /> | |
<meta property="og:headline" content="Site Name<?php wp_title(); ?>" /> | |
<?php if (get_post_meta($post->ID, 'image_id', true)){$postimage = wp_get_attachment_image_src(get_post_meta($post->ID, 'image_id', true), 'full'); ?> | |
<link rel="image_src" href="<?php echo $postimage[0]; ?>" /> |
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
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4 |
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 the below to your functions file | |
// then visit the page that you want to see | |
// the enqueued scripts and stylesheets for | |
function se_inspect_styles() { | |
global $wp_styles; | |
echo "<h2>Enqueued CSS Stylesheets</h2><ul>"; | |
foreach( $wp_styles->queue as $handle ) : | |
echo "<li>" . $handle . "</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
git checkout --orphan latest_branch && \ | |
git add -A && \ | |
git commit -am "initial commit" && \ | |
git branch -D master && \ | |
git branch -m master && \ | |
git push -f origin master | |
Taken from |
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
/** | |
* | |
* XDEBUG - Monokai scheme | |
* | |
* Palette: | |
* #272822 - grayish darkgreen, default background | |
* #F8F8F2 - ivory white, default font | |
* #75715E - tan, comment | |
* #FD971F - orange URLs without commas | |
* #AE81FF - purple numbers |
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
<meta property="og:title" content="" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:site_name" content=""/> | |
<meta property="og:image" content="" /> | |
<meta property="og:url" content="" /> | |
<meta property="og:description" content="" /> | |
<meta name="twitter:card" content="summary"> | |
<meta name="twitter:creator" content="@"> | |
<meta name="twitter:url" content=""> | |
<meta name="twitter:title" content=""> |
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
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
NewerOlder