Skip to content

Instantly share code, notes, and snippets.

View aranw's full-sized avatar

Aran Wilkinson aranw

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aranw on github.
  • I am aranw (https://keybase.io/aranw) on keybase.
  • I have a public key whose fingerprint is AEF5 4791 7C1B BB93 AA15 6DDD E2CA 29CF 18AB 5998

To claim this, I am signing this object:

id,name,description
1,bob,"Bob is amazing"
2,jim,"Jim is just as amazing as Bob"
package main
import (
"log"
)
func main() {
test := []int{1, 2, 3, 4, 5}
log.Println(test)
@aranw
aranw / gist:1434090
Created December 5, 2011 16:04
Javascript Defer Test
if (document.getElementById('testing')) {
document.getElementById('testing').innerHTML = 'Text should load using javascript.';
}
@aranw
aranw / gist:1438402
Created December 6, 2011 14:38
Google Analytics Social Tracking Code
(function (b) {
(function (a) {
"__CF" in b && "DJS" in b.__CF ? b.__CF.DJS.push(a) : "addEventListener" in b ? b.addEventListener("load", a, !1) : b.attachEvent("onload", a)
})(function () {
"FB" in b && "Event" in FB && "subscribe" in FB.Event && (FB.Event.subscribe("edge.create", function (a) {
_gaq.push(["_trackSocial", "facebook", "like", a])
}), FB.Event.subscribe("edge.remove", function (a) {
_gaq.push(["_trackSocial", "facebook", "unlike", a])
}), FB.Event.subscribe("message.send", function (a) {
_gaq.push(["_trackSocial", "facebook", "send", a])
@aranw
aranw / gist:1452068
Created December 9, 2011 15:54
Sticky Scrolling
$(document).ready(function(){
function sticky() {
var y = $(window).scrollTop();
if( y > (60) ){
$('.postnav').css({
'position': 'fixed',
'top': '0',
'left': ($(window).width() - $('.container').width())/2 - 10
});
} else {
@aranw
aranw / dabblet.css
Created December 16, 2011 11:53 — forked from cdettmar/dabblet.css
Tiles
/**
* Tiles
*/
Body {
background: #515151;
min-height:100%;
margin: 0px;
}
.Tile {
@aranw
aranw / gist:2036706
Created March 14, 2012 14:08
Bootbox.js Confirm
$(document).on("click", "a.reset",function(e) {
e.preventDefault();
bootbox.confirm("Are you sure you want to reset this users password?", function(confirmed) {
if (confirmed)
{
$.ajax({
url: e.currentTarget.href,
success: function()
{
location.reload();
@aranw
aranw / gist:3810637
Created October 1, 2012 09:54
Unique Slug Code
public static function unique_slug($title)
{
$post_slug = \Str::slug($title);
$next_slug = null;
$i = 0;
do
{
if ($i == 0)
{
@aranw
aranw / gist:3818727
Created October 2, 2012 12:39
daneden.local vhost
// This snippet below needs to be added to your apache config.
// Or add a extra vhosts.conf file and include it into your httpd.conf file with line...
Include /private/etc/apache2/other/vhosts.conf
// vhosts.conf
<VirtualHost *:80>
DocumentRoot "/Library/Webserver/Documents/daneden.me/"
ServerName daneden
ServerAlias daneden.local