Skip to content

Instantly share code, notes, and snippets.

View egardner's full-sized avatar

Eric Gardner egardner

View GitHub Profile
@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 / 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 / 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 / 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 / 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 / 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 / json_page_generator.rb
Created March 11, 2015 21:13
Jekyll Plugin: JSON Generator for Collection docs
module Jekyll
class JSONPage < Page
def initialize(site, base, dir, name, content)
@site = site
@base = base
@dir = dir
@name = name
self.data = {}
self.content = content
@egardner
egardner / chapters.js
Created March 7, 2015 01:32
Jekyll JS template for ember & pretender
---
---
var chapters = {
{% for chapter in site.chapters %}
{{chapter.id}}: {
id: {{chapter.id}},
title: "{{chapter.title}}",
content: "{{ chapter.content | strip_newlines | escape }}"
}{% if forloop.last %}{% else %},{% endif %}
{% endfor %}
@egardner
egardner / site.json
Created March 5, 2015 16:00
Jekyll JSON template
---
layout: null
---
[
{% for post in site.posts %}
{
"title" : "{{ post.title }}",
"url" : "{{ post.url }}",
"date" : "{{ post.date | date: "%B %d, %Y" }}",
"content" : "{{ post.content | strip_html | strip_newlines | escape_once }}"
#!/usr/bin/env ruby
require 'rubygems'
require 'twitter'
require 'json'
require 'faraday'
# things you must configure
PATH_TO_DROPBOX = "/Users/your_name/Dropbox/backup/tweets/" # you need to create this folder
TWITTER_USER = "your_twitter_username"