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
<?php
/**
* _s Theme Options
*
* @package _s
* @since _s 1.0
*/
/**
* Register the form setting for our _s_options array.
@robwilde
robwilde / dl-file.php
Last active August 29, 2015 14:11 — forked from hakre/dl-file.php
<?php
/*
* dl-file.php
*
* Protect uploaded files with login.
*
* @link http://wordpress.stackexchange.com/questions/37144/protect-wordpress-uploads-if-user-is-not-logged-in
*
* @author hakre <http://hakre.wordpress.com/>
* @license GPL-3.0+
<#
.SYNOPSIS
Migrates a Azure Virtual Machine to another subscription or data centre
.DESCRIPTION
Shutsdown the source VM
Exports the VM config to a temporary file
Loops through all Azure disks attached to the source VM
Schedules an async copy of the underlying VHD to the destination storage account
- optionally overwrites existing VHD in destination if it exists
jQuery(document).ready(function($) {
$('input#choice_13_1').click(function() {
if($(this).is(':checked')) {
$('#input_2_12_1').val($('#input_2_2_1').val());
$('#input_2_12_2').val($('#input_2_2_2').val());
$('#input_2_12_3').val($('#input_2_2_3').val());
$('#input_2_12_4').val($('#input_2_2_4').val());
$('#input_2_12_5').val($('#input_2_2_5').val());
};
});
@robwilde
robwilde / phpstorm.txt
Last active August 29, 2015 14:12 — forked from tvlooy/phpstorm.txt
ctrl + alt + shift + t = refactor this
alt + enter = allerlei shortcuts
ctrl + alt + l = reformat code
shift + f11 = show bookmarks
f11 = insert bookmark
alt + insert = file new
ctrl + n = navigate class
ctrl + shift + n = navigate file
ctrl + shift + f = find in path
ctrl + alt + shift + insert = commit file (eigen shortcut)
<?php
add_filter( 'gform_pre_render', 'log_pre_render' );
function log_pre_render( $form ) {
GFCommon::log_debug( "log_pre_render(): \$form => " . print_r( $form, true ) );
return $form;
}
add_action( 'gform_pre_process', 'log_pre_process' );
function log_pre_process( $form ) {
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(
@robwilde
robwilde / NFC+IONIC
Last active September 11, 2015 12:36 — forked from KillerCodeMonkey/NFC+IONIC
NFC in angular ionic app
<!-- used with <gap:plugin name="com.chariotsolutions.nfc.plugin" /> -->
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>nfc - Test</title>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
<meta charset="utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Style -->
@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 [email protected]

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.