Skip to content

Instantly share code, notes, and snippets.

View nathggns's full-sized avatar

Nate Higgins nathggns

View GitHub Profile
@nathggns
nathggns / parser.mockup
Created August 29, 2011 12:22
Mockup of input/output for my parser
/* Input */
foo {
bar: baz;
foo: {
baz: foo;
foo: baz;
}
@nathggns
nathggns / snippet.txt
Created August 29, 2011 13:38
Output of my parser
Array
(
[foo:] => Array
(
[0] => Array
(
[0] => bar:
[1] => baz;
)
@nathggns
nathggns / parser.php
Created August 29, 2011 13:44
Need help putting things in the right place
<?php
require_once 'util.php';
class parser {
public $instructions = array(); // Array - Instructions for the interpreter
public $css; // String - The formatted css code
public $tree = array(); // Array - The output tree
public $lines = array(); // Array - Lines of the formatted css code
public $level = array(); // Array - List of different arrays to append to
public $nest = 0; // Int - How far nested are we?
@nathggns
nathggns / parser.php
Created August 29, 2011 14:18
Source code for my parser
<?php
require_once 'util.php';
class parser {
public $instructions = array(); // Array - Instructions for the interpreter
public $css; // String - The formatted css code
public $tree = array(); // Array - The output tree
public $lines = array(); // Array - Lines of the formatted css code
public $level = array(); // Array - List of different arrays to append to
public $nest = 0; // Int - How far nested are we?
@nathggns
nathggns / snippet.txt
Created August 29, 2011 14:19
Output
Array
(
[foo:] => Array
(
[0] => baz: foo;
[1] => foo: baz;
)
[foo] => Array
(
@nathggns
nathggns / css-handler.php
Created August 31, 2011 19:31
My kickass less apache handler
<?php
require_once("lessc.php");
$file = $_SERVER["PATH_TRANSLATED"];
$array = explode('.', $file);
$nfile = $array[0] . '.less';
$name = $array[0];
header("Content-type: text/css");
if (file_exists($nfile))
{
$code = file_get_contents($nfile);
@nathggns
nathggns / musiccontrol.pyw
Created August 31, 2011 19:39
Keyboard Music Controller for iTunes (Windows)
from wmi import WMI
from win32com.client.gencache import EnsureDispatch
import pygtk; pygtk.require('2.0'); import gtk
import traceback, win32con, threading, wx
class Logic:
class iTunes:
def __init__(self): pass
def __init__(self):
@nathggns
nathggns / jquery.scrollbars.js
Created September 11, 2011 00:11
My plugin
(function($) {
$.fn.scrollbars = function() {
$(this).each(function() {
$.fn.scrollbars.run.call(this);
});
}
$.fn.scrollbars.run = function() {
// Create pointer to original this
base = $(this);
/* Created by Nathaniel Higgins - http://nath.is */
package net.minecraft.src;
import net.lahwran.ChatCommandEvent;
import net.lahwran.fevents.Listener;
public class TuneCraft_Event_np implements Listener<ChatCommandEvent>
{
private final mod_TuneCraft tuneCraft;
/* Located at minecraft/src/mod_TuneCraft.java */
/* Created by Nathaniel Higgins - http://nath.is */
package net.minecraft.src;
import java.io.*;
import net.lahwran.obf.Packet3EventChat;
import net.lahwran.ChatCommandEvent;
import net.lahwran.fevents.Order;
import net.nathggns.TuneCraft.*;