Skip to content

Instantly share code, notes, and snippets.

View derekblank's full-sized avatar

Derek Blank derekblank

  • Queensland, Australia
View GitHub Profile
@derekblank
derekblank / mission_beach.geojson
Created September 29, 2025 00:55
Mission Beach Planning and Mapping Project Area
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@derekblank
derekblank / modals.html.erb
Created January 14, 2015 03:56
Painless syntax highlighting in Rails
<% modal_markup = capture do %>
<div class="modal">
<label for="modal-1">
<div class="btn js-btn">Open Modal</div>
</label>
<input class="modal-state" id="modal-1" type="checkbox" />
<div class="modal-window">
<div class="modal-inner">
<label class="modal-close" for="modal-1"></label>
<h1>Sign In</h1>
@derekblank
derekblank / each.scss
Created February 9, 2014 17:36
Multi-dimensional each loop in Scss
// Irregular Sprite List
// The following icons have varying dimensions
// Key: icon-name background-position-x, background-position-y, absolute-position-x, absolute-position-y, width, height
$irregular-list:
dashboard -69px 0 45px 29px 46px 45px,
download -23px -121px 0 6px 33px 26px,
head-double -69px -123px 40px 34px 58px 36px,
head-stats -69px -46px 44px 31px 55px 39px,
head-with-tie -69px -85px 45px 34px 44px 37px,
@derekblank
derekblank / gist:7372431
Created November 8, 2013 15:16
app/public/config.php
<?php
/**
* Config Variables
*
* This file consist primarily of path variables to simplify
* the inclusion of assets and partials.
*/
/**
* If your deployment is in a directory update this variable
var alternateLineGraphData = {
labels: ["Jul 2013", "Aug 2013", "Sep 2013", "Nov 2013", "Dec 2013"],
datasets: [
{
fillColor: "#2c3e50",
strokeColor: "#111",
data: [630,185,403,495,174]
},
{
fillColor : "#3498db",
var chartCanvas = function(name, size) {
var $canvas = $('#' + name + '-canvas');
$canvas.attr(size || {
width : '200',
height : '200'
});
return $canvas.get(0) && $canvas.get(0).getContext("2d");
}
@derekblank
derekblank / map-interaction.js.coffee
Created June 11, 2013 20:57
Allow user to interact with Raphael regions
for region of worldRaphael
((rg, region) =>
worldRaphael[region].node.id = region
rg[0].onmouseover = (e) =>
rg.animate
fill: @hoverColor, 200
rg[0].onmouseout = (e) =>
rg.animate
fill: @baseColor, 200
rg[0].onclick = (e) =>
@derekblank
derekblank / map-init.js.coffee
Last active December 18, 2015 09:19
Initialize constructor and init functions for map.js.coffee
class WorldMap
constructor: ->
@baseColor = '#f5f3e6' # set the base fill color of the vector shapes
@hoverColor = '#053a5a' # set hover color
@R = Raphael('map', 960, 543) # create the canvas element #map and define dimensions
@defaultAttr =
fill: @baseColor # define default attributes for all paths
@init()
init: =>
@derekblank
derekblank / map.js.coffee
Created June 11, 2013 03:03
CoffeeScript to create an interactive map of the world using SVG and Raphaël.js
class WorldMap
constructor: ->
@baseColor = '#f5f3e6' # set the base fill color of the vector shapes
@hoverColor = '#053a5a' # set hover color
@R = Raphael('map', 960, 543) # create the canvas element #map and define dimensions
# define default attributes for all paths
@defaultAttr =
fill: @baseColor
'cursor': 'pointer'
'stroke-opacity': 0.001
@derekblank
derekblank / each.css.scss
Last active December 17, 2015 10:09
Sass @each loop examples
// Standard loop
@each $item in web, design, strategy, development, video, marketing {
&#wwd-#{$item} {
background-image: url('bg-wwd-#{$item}.jpg');
}
}
// Multi-dimensional loop