Skip to content

Instantly share code, notes, and snippets.

View cobbweb's full-sized avatar

Andrew Bucknall cobbweb

  • QLD, Australia
  • 03:54 (UTC +10:00)
View GitHub Profile
@cobbweb
cobbweb / compiler.js
Created April 30, 2012 01:11
Inject yylineno into AST nodes
var parser = require('./parser');
parser._performAction = parser.performAction;
parser.performAction = function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {
var ret = parser._performAction.call(this, yytext, yyleng, yylineno, yy, yystate, $$, _$);
// do stuff
if (this.$._type) {
this.$.lineNo = yylineno;
}
return ret;
@cobbweb
cobbweb / index.html
Created April 19, 2012 04:06 — forked from anonymous/css
jacksons
<!DOCTYPE HTML>
<html>
<head>
<!-- Head is the container for all of the head elements -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>QUT Video Gaming Society</title>
<!-- The title is what is shown in the window of the browser or in the tab of the browser -->
<meta name="description" content="Come join us play Video Games at QUT" />
<!-- This is the meta tag for the description of the website which will be given to search engines -->
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
@cobbweb
cobbweb / calc.jison
Created March 27, 2012 23:20
Basic multi-line calculator language in Jison
/* description: Basic multi-line calculator */
%lex
%%
[^\n\S]+ /* ignore whitespace */
[0-9]+ { return 'INT' }
(\n|\;) { return 'TERMINATOR' }
"-" { return '-' }
"+" { return '+' }
@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;
})();
@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 / connect-to.sh
Created December 6, 2011 06:46
SSH connect shortcuts
#!/bin/sh
# © Andrew Cobby <cobby@cobbweb.me>
# 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 / 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 / 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 / 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 / base.css
Created September 23, 2011 01:40
Button-ish anchors
/* make links move down 1px when clicked */
a:active {
position: relative;
top: 1px;
}