Skip to content

Instantly share code, notes, and snippets.

View connorjburton's full-sized avatar
🐰

Connor Burton connorjburton

🐰
View GitHub Profile
// This stub file contains items that aren't used yet; feel free to remove this module attribute
// to enable stricter warnings.
#![feature(exclusive_range_pattern)]
#![allow(unused)]
pub struct Player {
pub health: u32,
pub mana: Option<u32>,
pub level: u32,
}
@connorjburton
connorjburton / extend.php
Created January 8, 2016 11:10
Contact Form 7 Extending
<?php
function custom_elements($elements) {
$elements = custom_radio_workspaces($elements);
$elements = custom_radio($elements, 'custom-radio-people');
$elements = custom_radio($elements, 'custom-radio-people-workspace');
$elements = custom_radio($elements, 'custom-radio-person-status');
$elements = custom_radio($elements, 'custom-radio-room-hours');
return $elements;
}
var commanderQueue = function commanderQueue(phaseId, queuePayLoad, callback, thisArg) {
if(!Validator.payLoad(queuePayLoad)) { return false; }
var boundCallback = (callback) ? _.bind(callback, thisArg) : null;
var extraBindings;
var mustAPI = false;
if(queuePayLoad.type === Settings.types.ADD && boundCallback) {
var extraBindings = function() {
boundCallback.call(null, arguments[0]);
var _ = require('lodash');
var Qualifications = require('../config/Qualifications.jsx'); // = ['GCSE', 'A Level', 'KS4', 'AS', 'KS3'];
var Utilities = {
removeQualification: function(name) {
var newName = '';
_.forEach(Qualifications, function(quali) {
if(_.startsWith(name, quali)) {
var removeWords = _.words(quali);
var ImageUtilities = require('./Image.jsx');
var Parse = require('url-parse');
var _ = require('lodash');
var Validator = require('./Validator.jsx');
var VideoConfig = require('../config/modules/video/Video.jsx');
/**
* could do with a proper class, with proper constructors
factory('App\Models\User', 50)->create()->each(function($u) {
$u->posts()->save(factory('App\Models\User')->make());
});
@connorjburton
connorjburton / gist:c3e97e6c8f84846b6068
Last active August 29, 2015 14:14
Don't pay for RAMP, write 20 lines of code instead
function admin_real_preview($query) {
$allowedRoles = array(
'contributor',
'administrator'
);
$currentUser = wp_get_current_user();
$matchingRoles = array_intersect($allowedRoles, $currentUser->roles);
@connorjburton
connorjburton / SassMeister-input.scss
Created January 30, 2015 14:12
Generated by SassMeister.com.
// ----
// libsass (v3.1.0-beta)
// ----
@import "sass-list-maps";
$colour-primary: #293A4B;
$colour-secondary: #FF8600;
$colour-inactive: #AAAAAA;