Skip to content

Instantly share code, notes, and snippets.

View egardner's full-sized avatar

Eric Gardner egardner

View GitHub Profile
@egardner
egardner / Gemfile
Created July 27, 2015 22:57
Jekyll Livereload options
# Using Proteus-Jekyll gems here
source 'https://rubygems.org'
gem 'bourbon'
gem 'coffee-script'
gem 'jekyll'
gem 'jekyll-assets'
gem 'jekyll-haml'
gem 'neat'
@egardner
egardner / application.js
Created August 12, 2015 21:52
Ramjet.js Page Transition (first attempt)
//= require jquery.smoothState.min
//= require velocity.min
//= require velocity.ui.min
//= require ramjet.min
// =============================================================================
// Basic UI Control functions
function rightPanelToggle () {
var left = $(".panel--left");
@egardner
egardner / README.md
Last active September 22, 2022 15:42
Deep Zoom Image with multiple views – Leaflet.js

Multiple Image Layers in Leaflet JS

Reference code for setting up a basic multi-image deep zoom viewer in Leaflet.js. This example assumes that image tiles have been generated by something like MapTiler or a similar tool. There is also code in the <style> tags of the HTML <head> to override Leaflet's layers icon and replace it with a rotation icon, since that's a better indication of what's happening in this use-case.

L.control.layers() can accept accept a second argument for overlays (capable of existing simultaneously unlike baseMaps which are mutually exclusive.

@egardner
egardner / grid-functions.js
Created October 2, 2015 23:48
First Pass at creating a sortable image grid powered by Handlebars
// Grid Functions
//
// These functions manage the interactive catalogue grid.
// Users can filter by an arbitrary combination of criteria.
//
// Currently state is managed in a global gridSelection object.
// Its properties reflect the current key/value pairs for filter criteria.
// -----------------------------------------------------------------------------
@egardner
egardner / config.rb
Last active October 7, 2022 09:54
PDF Output for Middleman
# Only the relevant parts of config.rb are included here
require "extensions/pdf"
# ...
configure :build do
activate :pdf do |pdf|
pdf.print_template = "/catalogue/print-template.html"
end
end
@egardner
egardner / index.html
Last active December 11, 2015 02:00 — forked from anonymous/index.html
JS Bin[Leaflet extend test]// source http://jsbin.com/soperupuxu
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
#map {
@egardner
egardner / index.html
Last active December 11, 2015 04:29 — forked from anonymous/index.html
A basic working example of using a more OOP pattern to wrap Leaflet's API. source http://jsbin.com/yudenugugu
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
#map {
height: 800px;
@egardner
egardner / method.rb
Created February 4, 2016 02:23
Assignment Branch Condition
# Get Catalogue Sections
# Returns 3 arrays of resource objects (frontmatter, catalogue, backmatter)
def catalogue_sections
contents = sort_catalogue_contents
frontmatter = contents.find_all { |p| p.data.sort_order <= 10 }
backmatter = contents.find_all { |p| p.data.sort_order > 100 }
catalogue = contents.find_all do |p|
p.data.sort_order > 10 && p.data.sort_order <= 100
end
@egardner
egardner / spec_helper.rb
Created February 10, 2016 20:11
Middleman v4 Testing Setup
require "middleman"
require "middleman/rack"
require "middleman-core/rack"
require "rspec"
require "capybara/rspec"
require "capybara/webkit"
module MiddlemanApplication
extend RSpec::SharedContext
@egardner
egardner / print.scss
Created February 18, 2016 22:24
Starter print stylesheet (for Prince XML)
// Variables
// -----------------------------------------------------------------------------
$page-width: 8.5in;
$page-height: 11in;
$bleed: 0.125in;
$bleed-height: 11.25in;
$bleed-width: 8.75in;
$bottom-margin: 1in;