Skip to content

Instantly share code, notes, and snippets.

View huntlyc's full-sized avatar

Huntly Cameron huntlyc

View GitHub Profile
@huntlyc
huntlyc / player.gd
Last active October 12, 2023 13:16
Godot Simple 2d Movement
extends KinematicBody2D
var speed = Vector2(500, 2500)
var gravity = 8000
var friction = 0.1
var acceleration = 0.2
var velocity = Vector2.ZERO
func _physics_process(delta: float) -> void:
@huntlyc
huntlyc / keybase.md
Last active December 6, 2022 21:15
huntlyc keybase.io identity

Keybase proof

I hereby claim:

  • I am huntlyc on github.
  • I am huntlyc (https://keybase.io/huntlyc) on keybase.
  • I have a public key ASCi-AHk7nYx60Je5GbZJPERj-4zaGOp-7MWm7hjzVEneQo

To claim this, I am signing this object:

@huntlyc
huntlyc / blink.js
Last active March 3, 2016 10:57 — forked from alancolyer/blink.js
Felt sad that <blink> was deprecated? Cry no more!
@huntlyc
huntlyc / woocommerceImgWrap.php
Last active February 20, 2016 11:37 — forked from Bradley-D/WooCommerce: Add img-wrap div to archive and tag images
Wraps woocommerce product images - based on Bradley D's gist: https://gist.github.com/Bradley-D/9479200
<?php
/**
* wrapWoocommerceImages()
*
* Wraps woocommerce product images with spans making it easier to apply custom styles.
*
* This is a slightly more involved approach based on this gist:
* https://gist.github.com/Bradley-D/9479200
*
@huntlyc
huntlyc / svnli
Created January 28, 2015 16:36
svnli
#!/bin/bash
#
# Author: Huntly Cameron <huntly.cameron@gmail.com>
# Date: 2015-01-25
# Licence: MIT
# Description: if working dir, lists the root forlders of the repo + branches
##
# Try an info and redriect err to std input so we can save it to the status var
status=$(svn info 2>&1)
@huntlyc
huntlyc / functions.php
Created February 10, 2014 19:04
simple-events-custom-table
<?php
//Setup the shortcode:
// [rse_custom_events] - this works the same as the normal one
add_shortcode( 'rse_custom_events' , 'customised_event_table' );
/**
* Parses the shortcode and displays the events. The defalt is to only show
* events which are happening from the current time onwards. To change this
* the user can suppy the 'showevents' attribute with one of the following
@huntlyc
huntlyc / simple-events-custom-output.php
Created October 31, 2013 16:25
This example shows how to output an unordered list of all events using the Really Simple Events Plugin (http://wordpress.org/plugins/really-simple-events/)
<?php
/**
* Function documentation for 'hc_rse_get_events($listType, $showEvents = -1, $startdate = -1, $enddate = -1)'
* Depending on the list type, get the events
*
* @param str $listType - [all|all-reverse|upcoming|upcoming-reverse|past|past-reverse]
* @param int $showEvents (optional) - the number of events to show
* @param date $startdate (optional) - date range to start
* @param date $enddate (optional) - date range to finish
* @return $wpdb result set $events - Result set of the query
@huntlyc
huntlyc / hs-img-upload.js
Created June 20, 2013 09:03
WP 3.5 Image upload example
/**
Uploading files
Taken from: http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/
INSTRUCTIONS:
In the page you wish to use this script you'll need to enque the media scripts and this script.
Then create a input box and a button with NOTHING in between.. with the class 'upload_image_button'
<?php
wp_enqueue_media();
@huntlyc
huntlyc / .htaccess
Last active December 16, 2015 14:59
Custom redirects with WordPress
#Domain Redirect
<IfModule mod_rewrite.c>
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?huntlywordpress\.co\.uk$ [NC]
RewriteRule ^ http://www.huntlywordpress.com%{REQUEST_URI} [R=301,L]
</IfModule>
#EndDomain Redirect
#BEGIN custom redirects (single page)
<IfModule mod_rewrite.c>
@huntlyc
huntlyc / httpd.conf
Last active December 16, 2015 03:48
wp-login.php protection
#How to get this to work...
#First create your password file:
# - Replace $FILE and $USER with your values
# $> htpasswd -c $FILE $USER
#This goes into your apache config
# - Replace /PATH/TO/$FILE with the full path (incl file) to your
# created password file
<Files "wp-login.php">
AuthUserFile /PATH/TO/$FILE