Skip to content

Instantly share code, notes, and snippets.

View neilbradley's full-sized avatar

Neil Bradley neilbradley

View GitHub Profile

There are precompiled versions available for Windows, Linux (via apt-get/yum/etc) and Mac OS X. In addition to the precompiled versions, you can also install git via MacPorts. However, if you want the most recent version, or to install it in a non-standard location, compiling it from source is actually very easy (on Mac OS X at least).

You need to have Xcode installed, which provides a version of GCC. The most recent version can be obtained for free from the Apple Developer Connection. If you don’t have a fast internet connection or have some other reason not to download Xcode via Apple’s site, then you can always install Xcode from the Mac OS X DVD (from the folder labeled ‘Optional Installs’).

You can download the latest stable version of git from git’s website, in th

@brettbuddin
brettbuddin / grid.scss
Created October 17, 2010 17:17
My sassy CSS grid template. This is usually where I start from.
$column_width: 60px;
$gutter_width: 20px;
$columns: 12;
.container {
margin-bottom: 2em;
width: ($column_width * $columns) + ($columns - 1 * $gutter_width);
}
.clearfix, .container { display: block; }
.clearfix:after,
@brettbuddin
brettbuddin / switch.py
Created February 7, 2011 15:16
The code that powered the Twerrible Towel (http://twerribletowel.com). It processed 44,610 relevant tweets over the course of 5 days.
#!/usr/bin/env python
import sys
import random
from ctypes import *
from Phidgets.Devices.InterfaceKit import InterfaceKit
from Phidgets.PhidgetException import PhidgetErrorCodes, PhidgetException
try:
kit = InterfaceKit()
kit.openPhidget()
@necolas
necolas / snippet.js
Created June 14, 2011 20:36
Optimised async loading of cross-domain scripts
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(doc, script) {
var js,
fjs = doc.getElementsByTagName(script)[0],
@rsanchez
rsanchez / ext.cartthrob_example_extension.php
Created June 21, 2011 14:32
An example extension for CartThrob
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Cartthrob_example_extension_ext
{
public $settings = array();
public $name = 'CartThrob Example Extension';
public $version = '1.0.0';
public $description = 'CartThrob Example Extension';
public $settings_exist = 'n';
public $docs_url = 'http://cartthrob.com/';
@rsanchez
rsanchez / gist:1334725
Created November 2, 2011 20:04
CartThrob XML for Google Product Search
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>{site_name} Products</title>
<link>{site_url}</link>
<description>[insert store description here]</description>
{exp:channel:entries channel="products" rdf="off" dynamic_start="on" limit="1000" disable="member_data|trackbacks"}
<item>
<title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
@siffring
siffring / .htaccess
Created March 4, 2012 17:33
htaccess to password protect a specific server
# ----------------------------------------------------------------------
# Password protect staging server
# Use one .htaccess file across multiple environments
# (e.g. local, dev, staging, production)
# but only password protect a specific environment.
# ----------------------------------------------------------------------
SetEnvIf Host staging.domain.com passreq
AuthType Basic
AuthName "Password Required"
<?php
/* Return object of shared counts */
function get_social_count( $link ) {
$r = (object)array();
$r->facebook = get_social_count_facebook($link);
$r->twitter = get_social_count_twitter($link);
$r->gplus = get_social_count_gplus($link);
return $r;
}
@davist11
davist11 / 1 inspire.group index.html
Created April 19, 2012 01:17
Inspire Blog Templates
{embed="_layouts/blog"
blog_title="Inspire"
blog_slug="inspire"
blog_category_id="125"
blog_description="Design &amp; Interaction"
blog_description_more="our three hundred foot view. Primarily written by/for UX designers, visual designers, and front-end developers."
meta_description="Viget&rsquo;s Inspire blog: discussing all things design &amp; interaction including wireframing, typography, Photoshop tips and techniques, CSS, HTML5, and jQuery."
rss="{gv_inspire_feed}"
}
@tkadlec
tkadlec / trigram.html
Last active September 16, 2021 11:22
Trigram for heaven icon
<!DOCTYPE html>
<html>
<head>
<title>Trigram for heaven icon</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css">
li {
list-style-type: none;
}