Skip to content

Instantly share code, notes, and snippets.

@egrouse
egrouse / URL string
Created April 1, 2012 19:59
Sending Google Reader posts to OmniFocus for Mac
http://egrouse.com/tool/grof.php?t=${title}&u=${url}&s=${source}
<!DOCTYPE HTML>
<html lang="en-US">
<head>
[[$htmlhead]]
</head>
<body>
<section id="wrapper">
[[$sidebar]]
<section id="main">
<article class="post" id="post-[[*id]]">
$padding: 24px;
html { font-family: "Museo Sans", "Verdana", sans-serif; font-size: 62.5%; height: 100%; overflow-y: scroll; }
body { font-size: 1.2em; line-height: $padding; color: #444;
h1 { border-bottom: 1px solid #ddd; padding-bottom: $padding/4; margin-bottom: $padding/2; }
}
b, strong { color: #000; font-weight: bold; }
h1 { font-size: 1.5em; padding-bottom: $padding/2; }
@egrouse
egrouse / ch3q7-main.m
Created May 15, 2012 14:10
Completed exercises from 'Programming in Objective-C' - because why not?
//
// main.m
// ch3q7
//
// Created by Ellis Grouse on 15/05/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
// Book exercise: Chapter 3 Q7
// Make a class called XYPoint that holds 2 coordinates x,y and can set/get them separately
// Write functionality to output the information
//
@egrouse
egrouse / gist:3040051
Created July 3, 2012 14:29
WordPress meta issues
// Custom meta boxes for the homepage signs
add_action( 'add_meta_boxes', 'r6_add_sign_box' ); // Create meta box action
add_action( 'save_post', 'r6_save_postdata' ); // Save data for meta box
function r6_add_sign_box()
{
add_meta_box(
'r6_sign_meta',
'Homepage Signs',
'r6_draw_sign_box',
<pre>
<?php
function buildBaseString($baseURI, $method, $params) {
$r = array();
ksort($params);
print_r( $params );
foreach($params as $key=>$value){
$r[] = "$key=" . rawurlencode($value);
}
return $method."&" . rawurlencode($baseURI) . '&' . rawurlencode(implode('&', $r));
@egrouse
egrouse / bash-prompt.sh
Last active August 29, 2018 10:56
git PS1 for bash
#!/bin/bash
set_prompt()
{
local last_cmd=$?
local txtreset='$(tput sgr0)'
local txtbold='$(tput bold)'
local txtblack='$(tput setaf 0)'
local txtred='$(tput setaf 1)'
local txtgreen='$(tput setaf 2)'