I hereby claim:
- I am jshwlkr on github.
- I am jshwlkr (https://keybase.io/jshwlkr) on keybase.
- I have a public key whose fingerprint is 801F 80D6 331C 0265 78D7 9CA6 4811 5306 BCFF 5797
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# http://osxdaily.com/2013/02/05/improve-terminal-appearance-mac-os-x/ | |
# rearrange and colorize prompt | |
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ " | |
# add flags for ls: colorize output, add a slash after a directory, make sizes human readable | |
alias ls='ls -GFh' | |
# https://spin.atomicobject.com/2016/05/28/log-bash-history/ | |
# formats and exports command history |
function prefix_filter_embeds( $content ) { | |
if strpos( $content, 'string' ) !== false ) { | |
add_action( 'wp_head', 'prefix_url_actions', 0 ); | |
} | |
return $content; | |
} | |
add_filter( 'the_content', 'prefix_filter_embeds' ); | |
function prefix_url_actions() { |
add_filter( 'language_attributes', 'prefix_xml_namespaces' ); | |
function prefix_xml_namespaces($output) { | |
return $output . ' xmlns="http://www.w3.org/1999/xhtml" etc'; | |
} |
function prefix_template_meta() { | |
if (get_page_template_slug() == 'page template slug') { | |
// This is an arbitrary operation, in this case. You could do anything here. | |
// Beware making assumptions about the availability of things, like the post ID, if you change the action hook. | |
add_filter( 'language_attributes', 'prefix_xml_namespaces' ); | |
} | |
} |
function prefix_enqueued_assets() { | |
$version_string = NULL; | |
if ( 'production' !== wp_get_environment_type() ) { | |
$version_string = bin2hex(random_bytes(4)); | |
} | |
wp_register_style( | |
'prefix-theme-css', |
(?d).DS_Store | |
(?i).git* |
function redirect_search() { | |
if (is_search() && !empty($_GET['s'])) { | |
wp_redirect('https://cse.google.com/cse?cx=PSE_ID&q=' . urlencode(get_query_var('s')) ); | |
exit(); | |
} | |
} | |
add_action('template_redirect', 'redirect_search' ); |
add_action( 'rss2_item', 'prefix_add_rss_image' ); | |
function prefix_add_rss_image() { | |
global $post; | |
if ( is_feed() && has_post_thumbnail( $post->ID ) ) { | |
$image_url = get_the_post_thumbnail_url( $post->ID ); | |
if ( $image_url ) { | |
$image_id = get_post_thumbnail_id( $post->ID ); | |
if ( $image_id ) { | |
$image_title = get_the_title( $image_id ); |
function prefix_site_icon() { | |
// I'm assuming separate files for separate environments. | |
// You could adapt this to one svg icon with different css varaibles controlling the color per environemnt. | |
if ( ! has_site_icon() ) { | |
// this is your default/production favicon | |
$icon = '<link rel="apple-touch-icon" sizes="180x180" href="">'; | |
$icon .= "\n" . '<link rel="icon" type="image/png" sizes="32x32" href="">'; |