Skip to content

Instantly share code, notes, and snippets.

View theJasonJones's full-sized avatar

Jason Jones theJasonJones

  • Edward Jones
  • St. Louis, MO
View GitHub Profile
@theJasonJones
theJasonJones / gist:86a7aae04635c662e2c3
Created May 6, 2014 20:47
CodeIgniter Create account method
public function create_account() {
// Check the session. Same as before.
if ($this->session->userdata('logged_in')) {
$session_data = $this->session->userdata('logged_in');
} else { redirect('login', 'refresh'); }
// Set initial state of the form in the create_account view.
$data['message'] = "Create a New Admin Account";
// Check if the form has submitted.
//
// ZOOTabBarViewController.h
// ZooIBeaconApplication
//
// Created by Haidong Wang on 4/17/14.
// Copyright (c) 2014 Mizzou IT. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "ESTBeacon.h"
@theJasonJones
theJasonJones / messager.php
Created June 23, 2014 21:16
Simple WP Widget
<?php
error_reporting(E_ALL);
/*
Plugin Name: Messager Widget
Plugin URI: http://www.hazardouswasteexperts.com/
Description: A example of how to make a WordPress widget
Author: Jason Jones
Author URI: http://www.hazardouswasteexperts.com/
Version 1.0
*/
function useOfTime()
{
setTimeout(function()
{
confirm('Is this a good use of your time?')
}, 20000);
}
<?php
//might want a check here to make sure the values you need are available
require_once('wp-load.php');
global $wpdb;
//this function is just taking the $_REQUEST values and returning $wpdb-get_results()
$volunteers = jb_get_volunteers();
$header_line = array();
//Facebook
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php the_title(); ?>" title="Share on Facebook."></a>
//Reddit
<a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title(); ?>" title="Vote on Reddit"></a>
//LinkedIn
<a href="http://www.linkedin.com/shareArticle?mini=true&amp;title=<?php the_title(); ?>&amp;url=<?php the_permalink(); ?>" title="Share on LinkedIn"></a>
@theJasonJones
theJasonJones / wp-seo-tweaks.php
Last active November 16, 2023 20:49
Had to a few tweaks to the WP-SEO breadcrumbs. This is what I did.
<?php
// Remove the last link in breadcrumbs
// WHY? Because it an span tag that contains the title of the page
// But you're already on the page, so what's the point?
add_filter( 'wpseo_breadcrumb_links', 'jj_wpseo_breadcrumb_links' );
function jj_wpseo_breadcrumb_links( $links ) {
//pk_print( sizeof($links) );
if( sizeof($links) > 1 ){
array_pop($links);
@theJasonJones
theJasonJones / functions.php
Created April 5, 2016 15:41
Force URLs in srcset attributes into HTTPS scheme. A.K.A Fix for WP 4.4 responsive images.
/*
* Force URLs in srcset attributes into HTTPS scheme.
*/
function ssl_srcset( $sources ) {
foreach ( $sources as &$src ) {
$src['url'] = set_url_scheme( $src['url'], 'https' );
}
return $sources;
}
@theJasonJones
theJasonJones / carousel-fade.less
Created April 7, 2016 15:46
Carousel LESS used to make the BS slider fade from slide to slide.
@theJasonJones
theJasonJones / base-menu-styles.less
Last active April 7, 2016 18:32
Base styles for a BS nav menu that serve as a decent starting point.
.header{ margin-top: 25px;
nav { .container; padding-left: 0; margin-bottom: 0px;
a { color: #3d6c97; font-size: 18px; line-height:28px; font-weight: bold; }
li{
&:hover > a { background-color: #f1f1f1; }
&.menu-item-has-children {
& > a:after { font-family: 'FontAwesome'; content:"\f107"; margin-left: 10px; }
}
&.current-menu-item, &.current_page_parent { background-color: #f1f1f1;
a { color: white; }