Skip to content

Instantly share code, notes, and snippets.

View mralexgray's full-sized avatar

Alex Gray mralexgray

View GitHub Profile
@mralexgray
mralexgray / bash-stack.bash
Created September 11, 2011 12:49 — forked from tlrobinson/bash-stack.bash
Bash XML parser and stack, plus Gmail XML feed parsing example
#!/usr/bin/env bash
# Bash Stack
set -o errtrace
set -o errexit
set -o nounset
declare -a stack
@mralexgray
mralexgray / gist:1386737
Created November 22, 2011 19:57 — forked from inky/gist:888762
over the phone effect
lame -m s -a --preset 64 --lowpass 3.4 --highpass 0.42 in.mp3 out.mp3
# https://twitter.com/#!/marcoarment/status/51790511643697153
@mralexgray
mralexgray / cocoa-hello-world2.js
Created November 26, 2011 05:00 — forked from indexzero/cocoa-hello-world2.js
Creating a Cocoa GUI window with NodObjC, with a proper Menu, dock icon, and NSApplicationDelegate.
// This example adapted from Matt Gallagher's "Minimalist Cocoa Programming"
// blog article:
// http://cocoawithlove.com/2010/09/minimalist-cocoa-programming.html
var $ = require('NodObjC')
$.import('Cocoa')
var pool = $.NSAutoreleasePool('alloc')('init')
, app = $.NSApplication('sharedApplication')
@mralexgray
mralexgray / gist:1430251
Created December 4, 2011 13:52
geticon.sh, utility app icons.scpt
@mralexgray
mralexgray / browser.rb
Created December 4, 2011 16:36 — forked from AndrewO/browser.rb
A small Macruby script to display HTML piped in from STDIN.
framework 'Cocoa'
framework 'WebKit'
require 'optparse'
class Browser
attr_accessor :view
def initialize
@view = WebView.alloc.initWithFrame([0, 0, 520, 520])
// FROM: http://svn.cocoasourcecode.com/SkinnableApp/AppController.m
//
// AppController.m
// SkinnableApp
//
// Created by Matt Gemmell on 24/02/2008.
// Copyright 2008 Magic Aubergine. All rights reserved.
//
#import "AppController.h"
Index: sapi/cli/config.w32
===================================================================
--- sapi/cli/config.w32 (revision 308839)
+++ sapi/cli/config.w32 (working copy)
@@ -6,7 +6,8 @@
ARG_ENABLE('cli-win32', 'Build console-less CLI version of PHP', 'no');
if (PHP_CLI == "yes") {
- SAPI('cli', 'php_cli.c', 'php.exe');
+ SAPI('cli', 'php_cli.c php_http_parser.c php_cli_server.c', 'php.exe');
@mralexgray
mralexgray / appify
Created January 7, 2012 22:15 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh
@mralexgray
mralexgray / gist:1590118
Created January 10, 2012 17:25 — forked from lolautruche/gist:1447481
eZ Publish router script to be used with PHP 5.4 built-in webserver
<?php
// Router script for running eZ Publish CMS on top of PHP 5.4 built-in webserver
// WARNING !!! Use it for development purpose ONLY !!!
// This script is provided as is, use it at your own risk
// Determine which script to redirect to depending on rewrite rule to apply
// If the request needs to be served directly, $script needs to be null
$uri = $_SERVER['REQUEST_URI'];
$script = 'index.php';
<?php
## Nav data, as a JSON heredoc. Much less verbose than PHP arrays!
$navs = json_decode(<<<JSON
{
"mlb": {
"title_link": "http://stats.boston.com/mlb/scoreboard.asp",
"nav": [
{ "title": "Full Schedule", "url": "http://stats.boston.com/mlb/teamreports.asp?tm=02&report=schedule" },
{ "title": "Statistics", "url": "http://stats.boston.com/mlb/teamreports.asp?yr=2009&tm=2&btnGo=Go&report=stats" },