Skip to content

Instantly share code, notes, and snippets.

View campreb's full-sized avatar

Cameron Prebble campreb

View GitHub Profile
@campreb
campreb / addressfinder-jqueryui.js
Created May 30, 2011 01:20
AddressFinder using jQuery UI autocomplete
$("#ac_me").autocomplete({
source: function( request, response ) {
$.getJSON("http://api.addressfinder.co.nz/search/location?callback=?",
{q:request.term,key:"YOUR-API-KEY"},
function( data ) {
response( $.map( data.results, function( item ) {
return {
label: item.a,
pxid: item.pxid
}
@campreb
campreb / dabblet.css
Created December 19, 2011 01:42
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html{
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:100%;
}
.hello{
display:inline-block;
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
@campreb
campreb / Gemfile
Created August 26, 2012 23:53
Using Guard for CoffeeScript development
source "https://rubygems.org"
gem "therubyracer"
gem "guard"
gem "guard-coffeescript"
@campreb
campreb / Address.js
Created November 5, 2012 00:25
Use AddressFinder API with Sencha Touch 2
Ext.define('App.model.Address', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'a'
}, {
name: 'pxid'
}, {
name: 'v'
@campreb
campreb / index.html
Created November 27, 2012 21:46
Streetview Annotation
<!doctype html>
<html>
<head>
<title>Streetview Annotation</title>
<link type='text/css' rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.css" />
<style type="text/css">
#mapdiv{
position: absolute;
top: 0;
bottom: 0;
@campreb
campreb / gist:4561304
Created January 18, 2013 00:43
Fix Twitter Bootstrap effecting Google Maps
#map img{
max-width: none;
}
#map label {
width: auto;
display:inline;
}
@campreb
campreb / application.js
Last active December 18, 2015 01:38
D3 Ethnic Groups Demo
var groups = [
{name:"European",value:2949.0 },
{name:"Asian",value:924.0 },
{name:"Pacific",value:99.0 },
{name:"M\u0101ori",value:255.0 },
{name:"MELAA",value:87.0 },
@campreb
campreb / children.coffee
Last active December 18, 2015 18:49
A CodePen by Cameron Prebble.
children =
"Christina Daniel" : 12
"Brock Sanford" : 10
"Yasmin Feest" : 8
"Brock Sauer" : 7
"Christina Leannon" : 9
"Maci Block" : 11
"Ruben Macejkovic" : 5
"Aiyana Schneider" : 10
"Celestine Ullrich" : 11
<!DOCTYPE html>
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<style>
body {
font: 10px sans-serif;
}
rect {