Skip to content

Instantly share code, notes, and snippets.

View cobbweb's full-sized avatar

Andrew Bucknall cobbweb

  • QLD, Australia
  • 15:49 (UTC +10:00)
View GitHub Profile
@cobbweb
cobbweb / MODM140Test.php
Created April 15, 2011 00:51
Testing nested embedded documents in Doctrine ODM (BETA3)
<?php
namespace Doctrine\ODM\MongoDB\Tests\Functional\Ticket;
use Doctrine\Common\Collections\ArrayCollection,
Documents\Functional\EmbeddedTestLevel0,
Documents\Functional\EmbeddedTestLevel1,
Documents\Functional\EmbeddedTestLevel2;
class MODM140Test extends \Doctrine\ODM\MongoDB\Tests\BaseTest
@cobbweb
cobbweb / MoveEmbeddedDocuments.php
Created April 20, 2011 05:13
How to move embedded documents between parent documents in Doctrine ODM
<?php
namespace Doctrine\ODM\MongoDB\Tests\Functional;
use Doctrine\Common\Collections\ArrayCollection,
Documents\Functional\EmbeddedTestLevel0,
Documents\Functional\EmbeddedTestLevel1,
Documents\Functional\EmbeddedTestLevel2;
class MoveEmbeddedDocuments extends \Doctrine\ODM\MongoDB\Tests\BaseTest
@cobbweb
cobbweb / example.conf
Created July 29, 2011 04:19
Nginx and PHP-FPM
server {
listen 8080;
server_name example.dev www.example.dev;
location / {
root /Users/Cobby/Sites/Example;
if ($host = 'www.example.dev' ) {
rewrite ^/(.*)$ http://example.dev:8080/$1 permanent;
}
@cobbweb
cobbweb / base.css
Created September 23, 2011 01:40
Button-ish anchors
/* make links move down 1px when clicked */
a:active {
position: relative;
top: 1px;
}
@cobbweb
cobbweb / NewInvoice.xml
Created October 24, 2011 22:14
Create a PAID invoice in Xero (Attempt #1)
<?xml version="1.0"?>
<Invoices>
<Invoice>
<Type>ACCREC</Type>
<Contact>
<ContactID>427f9f6c-8d02-403b-9e8b-e22a77a33c05</ContactID>
</Contact>
<InvoiceNumber>11001691</InvoiceNumber>
<DueDate>2011-10-30</DueDate>
<Date>2011-10-24</Date>
@cobbweb
cobbweb / vm.js
Created December 2, 2011 02:05
Virtual Machine
var VM = {
cpu: {
ip: 0x00,
r0: 0x00,
r1: 0x00,
r2: 0x00,
r3: 0x00,
@cobbweb
cobbweb / main.c
Created December 2, 2011 03:56
Part 1
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/utsname.h>
@cobbweb
cobbweb / connect-to.sh
Created December 6, 2011 06:46
SSH connect shortcuts
#!/bin/sh
# © Andrew Cobby <[email protected]>
# Creates shortcuts to log into remote servers
# Setup private/public key auth for passwordless logins
# USAGE: $ ./connect-to.sh example
# Defaults
user="root"
@cobbweb
cobbweb / fonts.css
Created February 3, 2012 05:02
Open Sans
/*==========================================================
Open Sans
==========================================================*/
@font-face {
font-family: 'OpenSans';
src: url('../fonts/OpenSans-Light-webfont.eot');
src: url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
url('../fonts/OpenSans-Light-webfont.ttf') format('truetype'),
@cobbweb
cobbweb / jQuery.support-transition.js
Created February 19, 2012 23:26 — forked from jonraasch/jQuery.support-transition.js
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();