Skip to content

Instantly share code, notes, and snippets.

View tipiirai's full-sized avatar

Tero Piirainen tipiirai

View GitHub Profile
@tipiirai
tipiirai / another.js
Created November 5, 2010 20:22
working with gists
// foo
var bar = "baz";
@tipiirai
tipiirai / gist:783992
Last active September 24, 2015 17:37
The most minimal draggable
var draggable
// disable IE specialities
document.ondragstart = function () { return false }
// bound dragging into document
var doc = $(document).bind("mousedown mouseup", function(e) {
var el = $(e.target)
@tipiirai
tipiirai / gist:4544584
Created January 16, 2013 04:13
jQuery.browser for v1.9+
/*
jQuery.browser for 1.9+
We all love feature detection but that's sometimes not enough.
@author Tero Piirainen
*/
!function($) {
if (!$.browser) {
@tipiirai
tipiirai / gist:a1f2d1f203de0b5f45a1
Created July 2, 2014 02:12
Riot.js full router
(function() {
var routes = [];
function on(route, fn) {
var keys = ['match'];
route = route.replace(/[\/\=\?\$\^]/g, '\\$&').replace(/\{(\w+)\}/g, function(match, key) {
keys.push(key);
return '(\\w+)';
});
@tipiirai
tipiirai / gist:4ba6168f4ca79ee4def4a9dfe536d9eb
Last active September 9, 2026 08:02
Hertta site format

Hertta site format

hertta-site/v1 is Hertta's only authoring format: a content-first, normalized multi-file source tree. AI focuses on content and structure; presentation (theme, layout mechanics, CSS) is handled separately. It is not one JSON page document and not unrestricted YAML.

Two page formats live inside a site: YAML for rich, sectioned pages (landing pages, pricing, features) and Markdown for content-dominant pages (blog posts, documentation).

The platform-owned SITE_FORMAT_V1 registry in integration/generator/registry.ts is the executable source of truth for themes, components, properties, limits, routes, examples, and hash framing. Call site.format to get the same description live rather than trusting a static copy of this doc — the registry is what actually validates.

site.format also returns a model-facing authoring guide: an ordered workflow, page-mode and site-shell decisions, an exhaustive component guide with source fragments, composition recipes, quality and truthfulness ch