Skip to content

Instantly share code, notes, and snippets.

View robwilde's full-sized avatar
🏠
Just keep Coding, keep on Coding...

Robert Wilde robwilde

🏠
Just keep Coding, keep on Coding...
View GitHub Profile
@robwilde
robwilde / testing.php
Created March 1, 2017 04:59
CDN or Local jQuery call
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="assets/js/jquery.min.js"><\/script>')</script>
@robwilde
robwilde / API.md
Created May 24, 2016 03:57 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@robwilde
robwilde / functions.php
Created March 21, 2016 12:18
Disable easy fancybox for a page
/**
* disable fancy box for the gallery page
*/
function disable_fancybox() {
if ( is_page( 'gallery' ) ) {
remove_action('wp_enqueue_scripts', array('easyFancyBox', 'enqueue_styles'), 999);
remove_action('wp_head', array('easyFancyBox', 'main_script'), 999);
remove_action('wp_print_scripts', array('easyFancyBox', 'register_scripts'), 999);
remove_action('wp_footer', array('easyFancyBox', 'enqueue_footer_scripts'));
remove_action('wp_footer', array('easyFancyBox', 'on_ready'), 999);
<ion-view view-title="{{ticker}}">
<div class="bar bar-subheader bar-light">
<div class="button-bar">
<div class="button button-clear">
<h6>Company Name Inc.</h6>
</div>
<h5 class="tittle button-left button-right">1000.5000</h5>
<div class="button button-clear">
@robwilde
robwilde / wp-singleton-namespace-example.php
Created October 30, 2015 10:45 — forked from szbl/wp-singleton-namespace-example.php
Quick Singleton class to be included in WordPress plugin (or theme functions.php file) that will create a simple Person post type and shows some methods of encapsulating functionality in a class as a "namespace," as well as applying filters to things, allowing other users to extend your code.
<?php
class Sizeable_Person
{
const POST_TYPE_SLUG = 'szbl-person';
public static $instance;
public static function init()
{
if ( is_null( self::$instance ) )
@robwilde
robwilde / Contract Killer 3.md
Created October 27, 2015 22:26
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: October 8th 2015
  • Original post

DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- please change the set @path = 'change to your backup location'. for example,
-- SET @path = 'C:\backup\'
-- or SET @path = 'O:\sqlbackup\' if you using remote drives
-- note that remotedrive setup is extra step you have to perform in sql server in order to backup your dbs to remote drive
-- you have to chnage you sql server accont to a network account and add that user to have full access to the network drive you are backing up to
/**
* is_edit_page
* function to check if the current page is a post edit page
*
* @author Ohad Raz <admin@bainternet.info>
*
* @param string $new_edit what page to check for accepts new - new post page ,edit - edit post page, null for either
* @return boolean
*/
function is_edit_page($new_edit = null){
//This is not production quality, its just demo code.
var cookieList = function(cookieName) {
//When the cookie is saved the items will be a comma seperated string
//So we will split the cookie by comma to get the original array
var cookie = $.cookie(cookieName);
//Load the items or a new array if null.
var items = cookie ? cookie.split(/,/) : new Array();
//Return a object that we can use to access the array.
//while hiding direct access to the declared items array
@robwilde
robwilde / tutorial.md
Created October 7, 2015 00:48 — forked from winhamwr/tutorial.md
Creating a repeatable, dynamic site to site VPN with OpenSwan on Ubuntu 10.04 from Amazon EC2

Creating a dynamic site-to-site VPN with OpenSwan on Ubuntu 10.04 on EC2

Wes Winham winhamwr@gmail.com

There are many tutorials floating around the web that almost get you a dynamic VPN in EC2. The goal of this tutorial is to be a one-stop-shop for this specific setup.