Skip to content

Instantly share code, notes, and snippets.

somone said this would be easy. someone LIED.

Norcross norcross

somone said this would be easy. someone LIED.
View GitHub Profile
norcross / youtube-thumbs
Created Apr 14, 2013
get YouTube thumbnails
View youtube-thumbs<insert-youtube-video-id-here>/0.jpg<insert-youtube-video-id-here>/1.jpg<insert-youtube-video-id-here>/2.jpg<insert-youtube-video-id-here>/3.jpg
The first one in the list is a full size image and others are thumbnail images. The default thumbnail image (ie. one of 1.jpg, 2.jpg, 3.jpg) is:<insert-youtube-video-id-here>/default.jpg
For the high quality version of the thumbnail use a url similar to this:
norcross / norcross-debug-functions.php
Last active Mar 29, 2021
my list of debugging functions to keep in an MU file
View norcross-debug-functions.php
Plugin Name: Norcross Debug Functions
Plugin URI:
Description: A set of functions I use on all sites while building
Author: Andrew Norcross
Version: 0.0.1
Requires at least: 3.0
Author URI:
norcross / country-array.php
Last active Jan 24, 2020 — forked from DHS/PHP Countries Array
PHP array of all country names
View country-array.php
$countries = array(
'American Samoa',
norcross / cron-delete-revisions.php
Created Dec 18, 2012
set cron to delete post revisions
View cron-delete-revisions.php
// add filter to allow for new weekly schedule
add_filter( 'cron_schedules', 'rkv_weekly_cron' );
function rkv_weekly_cron( $schedules ) {
// Adds once weekly to the existing schedules.
$schedules['weekly'] = array(
'interval' => 604800,
'display' => __( 'Once Weekly' )
norcross / validate-passwords.js
Created Jan 19, 2013
some basic javascript password validation
View validate-passwords.js
// **************************************************************
// password validation
// **************************************************************
function checkPassword(pass) {
var numbers = pass.match(/\d+/g);
var uppers = pass.match(/[A-Z]/);
var lowers = pass.match(/[a-z]/);
var special = pass.match(/[!@#$%\^&*\+]/);
norcross / wp-script-calls.php
Created Aug 23, 2012
using wp_enqueue_scripts and admin_enqueue_scripts
View wp-script-calls.php
// front end
function custom_front_scripts() {
wp_enqueue_style( 'front-css', plugins_url('/lib/css/front-css.css', __FILE__), array(), null, 'all' );
wp_enqueue_script( 'front-init', plugins_url('/lib/js/front.init.js', __FILE__) , array('jquery'), null, true );
add_action('wp_enqueue_scripts', 'custom_front_scripts' );
// back end
function custom_admin_scripts() {
norcross / WooUpgradeTestSuiteCest.php
Last active Mar 7, 2019
Run various acceptance tests for WooCommerce
View WooUpgradeTestSuiteCest.php
* WooCommerce Upgrade Test Suite
* A set of acceptance tests for a standard WooCommerce store.
// It'll error out sometimes without this ¯\_(ツ)_/¯ .
norcross / csv-export-example.php
Created Aug 9, 2015
a basic CSV export example
View csv-export-example.php
* Devin CSV Export
* Contains our export processing
Copyright 2015 Reaktiv Studios
This program is free software; you can redistribute it and/or modify
norcross / admin-bar-kill.php
Created Jan 17, 2013
remove admin bar globally on front and back end
View admin-bar-kill.php
add_action ( 'init', 'rkv_adminbar_front_kill' );
add_action ( 'admin_init', 'rkv_adminbar_back_kill' );
function rkv_adminbar_front_kill() {
show_admin_bar( false );
norcross / emailbot_ssc.php
Created Oct 1, 2012
Obfuscate email shortcode
View emailbot_ssc.php
Usage (on the HTML tab, not the visual editor)
[email address=""]
function emailbot_ssc($attr) {
extract( shortcode_atts( array(
'address' => '',
), $attr ) );