Skip to content

Instantly share code, notes, and snippets.

View jimboobrien's full-sized avatar

Jimobrien jimboobrien

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<pre class="root">
{"lastUpload":"2021-03-24T13:58:30.335Z","extensionVersion":"v3.4.3"}
@jimboobrien
jimboobrien / svg-cleanup.js
Created May 22, 2019 15:16 — forked from nt1m/svg-cleanup.js
svg-cleanup.js
// WIP, most of this doesn't work
var svgns = "http://www.w3.org/2000/svg";
var banned = {
namespaces: ["sketch", "illustrator", "sopodi", "inkscape"],
tags: ["title", "desc"],
tagsIfEmpty: ["defs", "g", "style"],
attributes: ["enable-background", "xml:space", "version"]
};
var invisibleShapesData = {
<?php
/*
* rest_api_init
* Custom /upload route
*
* @since 3.0
*/
add_action( 'rest_api_init', function () {
@jimboobrien
jimboobrien / wp_select_example.php
Created October 13, 2017 21:49
This shows you to setup a page for a WordPress plugin with settings including a select field
<?php
function pegasus_nav_plugin_settings_page() { ?>
<div class="wrap">
<h1>Nav</h1>
<form method="post" action="options.php">
<?php
settings_fields("section2");
do_settings_sections("theme-options2");
@jimboobrien
jimboobrien / gist.php
Created September 20, 2017 23:49 — forked from ajmorris/gist.php
Embed Gists into your Blog posts with this
**
* Usage:
* Paste a gist link into a blog post or page and it will be embedded eg:
* https://gist.github.com/2926827
*
* If a gist has multiple files you can select one using a url in the following format:
* https://gist.github.com/2926827?file=embed-gist.php
*/
wp_embed_register_handler( 'gist', '/https:\/\/gist\.github\.com\/(\d+)(\?file=.*)?/i', 'wp_embed_handler_gist' );
printf "MySQL User: "
read MYSQLUSER
if [ "$MYSQLUSER" = "" ]; then
set MYSQLUSER = "root"
fi
printf "MySQL Password: "
read MYSQLPWD
if [ "$MYSQLPWD" = "" ]; then
set MYSQLPWD = "asdfasdf"
fi
@jimboobrien
jimboobrien / searchform.php
Created September 20, 2017 23:43 — forked from ajmorris/searchform.php
Sample Search form
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/">
<label class="hidden" for="s"><?php _e('Search:'); ?></label>
<input class="search-field" type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
<input class="search-button primary medium" type="submit" id="searchsubmit" value="GO" />
</form>
<?php
/**
* Setup Theme Design
*/
function ajm_setup_design() {
$headway_defaults = array(
/* Defaults */
'default-text' => array(
'properties' => array(