Skip to content

Instantly share code, notes, and snippets.

View matthewpizza's full-sized avatar
🌸
°˖✧◝(◠ᴥ◠)◜✧˖°

matthewpizza

🌸
°˖✧◝(◠ᴥ◠)◜✧˖°
View GitHub Profile
# lifted cool stuff from:
# https://github.com/fish-shell/fish-shell/blob/master/share/functions/fish_prompt.fish
# https://github.com/fish-shell/fish-shell/blob/master/share/tools/web_config/sample_prompts/robbyrussell.fish
function fish_prompt
# define git functions if not already defined
if not set -q -g __fish_git_functions_defined
set -g __fish_git_functions_defined
function _git_branch_name
<?php
add_action( 'init', function() {
$fieldmanager = new Fieldmanager_Group( array(
'name' => 'tc_faq_fields',
'limit' => 0,
'label' => 'New FAQ',
'label_macro' => array( 'FAQ: %s', 'question' ),
'add_more_label' => 'Add another FAQ',
@matthewpizza
matthewpizza / is-theme-customizer.js
Last active August 29, 2015 14:05
JavaScript check to see if a WordPress site is currently being loaded by the Theme Customizer
/**
* Is this WordPress site currently being loaded in the theme customizer iframe?
*
* @return {Boolean} Most likely.
*/
function isThemeCustomizer() {
if ( window.parent.location === window.location ) {
return false;
}
<font style="font-family: Comic Sans MS; font-size:16px; color: #002b60">
Dear Cleveland, All Of Northeast Ohio and Cleveland Cavaliers Supporters Wherever You May Be Tonight;
<br /><br />
As you now know, our former hero, who grew up in the very region that he deserted this evening, is no longer a Cleveland Cavalier.
<br /><br />
@matthewpizza
matthewpizza / iframe.html
Created May 30, 2014 20:47
Finding DOM limits
<body>
<script>
for (var i = 0; i < 10000000000; i++) {
window.setInterval( function() {
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
}, 0.00000000000000000001 );
};
</script>
</body>
<?php
/**
* Register Archive Pages Taxonomy
*/
add_action( 'init', function () {
register_taxonomy( 'archive_pages', 'nav_menu_item', array(
'labels' => array(
'name' => 'Archive Pages',
#!/bin/bash
###################
# Access to Tools #
###################
# Variables
## get current directory path
pushd `dirname $0` > /dev/null
var all = document.getElementsByTagName('*');
var max = window.innerWidth;
for (var i = 0; i < all.length; i++) {
var el = all[i];
var width = all[i].offsetWidth;
if (width <= max) {
continue;
}
@matthewpizza
matthewpizza / write_data_attribute.js
Created April 27, 2014 23:02
Wring data attributes
(function($){
$.fn.extend({
wdata : function( key, value ) {
this.attr('data-' + key, value);
}
});
})(jQuery);