Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Brinneman danielbrinneman

View GitHub Profile
@danielbrinneman
danielbrinneman / plugin.php
Created Aug 27, 2020 — forked from kovshenin/plugin.php
Settings API Demo
View plugin.php
<?php
/**
* Plugin Name: My Plugin
* Plugin Description: Settings API Demo
*/
add_action( 'admin_menu', 'my_admin_menu' );
function my_admin_menu() {
add_options_page( 'My Plugin', 'My Plugin', 'manage_options', 'my-plugin', 'my_options_page' );
}
@danielbrinneman
danielbrinneman / gist:e0e90a3fd18eb42d9e35581210a9490d
Last active Sep 25, 2018
Jekyll Codeship Rakefile GitHub Pages
View gist:e0e90a3fd18eb42d9e35581210a9490d
system rake generate
system rake publish
require 'tmpdir'
desc "Generate jekyll site"
task :generate do
puts "## Install bundles"
system "bundle install"
puts "## Generating Site with Jekyll"
system "bundle exec jekyll build --incremental"
puts "## Jekyll Webmention"
View bookmark-this-page.html
<a href="javascript:if(document.all)window.external.AddFavorite(location.href,document.title); else if(window.sidebar)window.sidebar.addPanel (document.title,location.href,'');">Bookmark this page</a>
@danielbrinneman
danielbrinneman / sortable-table.html
Last active May 4, 2017
I created this to replicate the staff list on a website but only use one page and add one more column for the department that would have a non-sortable table followed by a sortable table.
View sortable-table.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Directory Table</title>
<script src="https://code.jquery.com/jquery.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.13.3/jquery.tablesorter.min.js"></script>
View Mobile Responsive Images - WordPress - TonyaBoltonPhotography.com
/* Place DIV around both images to target the two inside */
<div class=“tbp-images”>
<p><a…<img… </a></p>
<p><a…<img… </a></p>
</div>
View Custom Post Type and Taxonomies
Custom Post Type
function create_post_type_reservations() {
register_post_type( 'reservations', array(
'labels' =&gt; array(
'name' =&gt; __( 'Reservations' ),
'singular_name' =&gt; __( 'Reservation' ),
@danielbrinneman
danielbrinneman / index.html
Last active Oct 30, 2017
PayPal Form and jQuery
View index.html
/*
** Please credit me when using this jQuery code -
** jQuery code from scratch by Daniel Brinneman - Copyright Aug 11-15, 2012 - www.lionsdendesigns.com
*/
<!DOCTYPE html />
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset="UTF-8" />