Skip to content

Instantly share code, notes, and snippets.

View interactiveRob's full-sized avatar

Rob Kirkner interactiveRob

View GitHub Profile
@Garconis
Garconis / acf-states.txt
Created August 10, 2018 16:21 — forked from michaeldozark/acf-states.txt
State list for Advanced Custom Fields select field
AL : Alabama
AK : Alaska
AZ : Arizona
AR : Arkansas
CA : California
CO : Colorado
CT : Connecticut
DE : Delaware
DC : District of Columbia
FL : Florida
@MichaelWhi
MichaelWhi / tplink.sh
Created November 10, 2017 21:39
Turn TP Link SmartPlug on and off via Command line
@Shumaher
Shumaher / header.php
Last active April 24, 2018 14:42
Open Graph tags for WordPress, see http://blog.alexz.me/wp-opengraph for more info
<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]; ?>" />
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4
@omurphy27
omurphy27 / echo-enqueued-styles-scripts-wordpress.php
Last active March 8, 2024 07:19
Wordpress - Print Out All Enqueued Scripts And Styles On A Page
<?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>";
@vwasteels
vwasteels / getMenuHierarchically.md
Last active June 28, 2022 13:12
Retrieve menu items hierarchically in Wordpress
/**
 * 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();
@szydan
szydan / gist:75b8a03b3fb4e099d5c1
Last active April 3, 2022 01:26
delete all commits from repo
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
@baranok
baranok / xdebug-monokai.css
Last active November 16, 2022 22:07
theme for php xdebug
/**
*
* 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
<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="">
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active July 2, 2024 00:02
how to delete a git tag locally and remote
# 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