Skip to content

Instantly share code, notes, and snippets.

View futuraprime's full-sized avatar

Evan Hensleigh futuraprime

  • The Economist
  • London, UK
View GitHub Profile
@futuraprime
futuraprime / Holy Grail Layout: solved
Created August 11, 2010 15:38
A minimal solution to the "Holy Grail" CSS layout
<!DOCTYPE html>
<html>
<head>
<title>The Holy Grail - 3 Column CSS layout</title>
<style type="text/css" media="screen">
/* #content is the bounding box. It must have position: relative to anchor it for the background
* columns, and it must have overflow: hidden so it expands to contain floated content within it
* (you could also use a clear div below the columns, if you want to avoid hiding the overflow) */
#content { width:960px; overflow: hidden; position: relative; zoom: 1;}
@futuraprime
futuraprime / gist:940906
Created April 25, 2011 18:04
Tilemill Installation Log
computer:tilemill ehensleigh$ ./ndistro clean
... cleaning build directories
computer:tilemill ehensleigh$ ./ndistro
... building node-0.2.6
######################################################################## 100.0%
Waf: Entering directory `/webserver/tilemill/src/node-0.2.6/build'
DEST_OS: darwin
DEST_CPU: x86_64
Parallel Jobs: 1
[ 1/69] cc: deps/libeio/eio.c -> build/default/deps/libeio/eio_1.o
/* sigdig
*
* rounds the number to a specified number of significant digits
*/
['sigdig', false, function(setting, data) {
if (typeof data[1] == "number") {
var num_store = data[1],
order = Math.ceil(Math.log( num_store )/Math.log(10)), // get order of magnitude from log10
n_down = num_store/Math.pow(10, order); // drop down
var Foo = function() {
// constructory business
}
Foo.prototype = {
prop: "property",
method: function() {
// methodical business
}
}
@futuraprime
futuraprime / toura_component.js
Created December 15, 2011 14:42
A potential rewrite of the toura.component function
toura.component = function(name, proto, opts) {
var ancestors = [toura._Component];
var namespace = opts.namespace || 'client.components';
if (opts.ancestors) {
// concat is a synonym for "push" when fed a non-array
ancestors = ancestors.concat(opts.ancestors);
}
var p = dojo.mixin(proto, {
templateString : proto.componentTemplate || '%div',
@futuraprime
futuraprime / repo.txt
Created December 15, 2011 18:33 — forked from rmurphey/repo.txt
mulberry repo & scaffold reorg proposal
- lib
- cli (nee mulberry)
- js (nee toura_app)
--- vendor
--- mulberry
----- _Capability.js
----- _Component.js
----- Page.js (nee toura_app/pageControllers/Configurable.js)
----- base.js
----- base.css
@futuraprime
futuraprime / gist:2053131
Created March 16, 2012 22:07
Video test
it("should change its media when prompted", function() {
var c = new C(config).placeAt(t);
c.prepareData();
c.startup();
c.set('media', feed_media);
//expect(c.media).toEqual(feed_media);
@futuraprime
futuraprime / popover.css
Created April 20, 2012 19:09
Neven's Popover
.popover {
/* to be set as appropriate */
width: 200px;
height: 200px;
margin: 20px;
background-color: white;
padding: 20px;
border-radius: 6px;
position: relative;
@futuraprime
futuraprime / gist:2727011
Created May 18, 2012 18:50
Mulberry Roadmapping

Page state

We should have a system within Mulberry for controlling and maintaining page states across transitions. Things we might want to remember:

  • where a scrolling region was scrolled to
  • what screen of a multi-screen template was last viewed
  • form data

The system would need to record these things and be able to store them during page destruction and recall them when the page is reassembled. It should also be able to maintain some things while a page is still in memory, as we may want to record some things during a page's lifecycle (e.g. a scrolling area that's constructed/destroyed on orientation change). The developer should also be able to control when this information is destroyed (either with an expiration date/time or by explicitly deleting it).

@futuraprime
futuraprime / pre-commit.rb
Created June 18, 2012 15:32
Pre-commit error catcher
#!/usr/bin/env ruby
# Git pre-commit hook that prevents accidentally committing things that shouldn't be, like:
#
# * ":focus", used with RSpec/Guard
# * "show_page", used to debug request specs
# * "console.log" or "console.debug", used in JavaScript debugging
# * "DO NOT COMMIT!" comments
#
# Modify the regexps to suit your needs. The error message shows the full regexp match, or just the first capture group, if there is one.