Skip to content

Instantly share code, notes, and snippets.

View sindre's full-sized avatar

Sindre Wimberger sindre

View GitHub Profile
@sindre
sindre / pGA.js
Created December 1, 2009 15:18
Monitor events with Google Analytics ga.js tracking code
/* pGA - Monitor events with Google Analytics ga.js tracking code
* port of jGoogleAnalytics (version 1.0 2008-06-18) to use prototype
*
* @author: Sindre Wimberger // wimberger@echonet.at
* @version: 1.0 2009-05-20
*
* Requires Prototype 1.6.1 or higher
*
* Uses some elements of gaTracker (c)2007 Jason Huck/Core Five Creative
* http://plugins.jquery.com/files/jquery.gatracker.js_0.txt
@sindre
sindre / gist:327765
Created March 10, 2010 11:05 — forked from jgornick/gist:50602
JS ImagesObserver
/*
Title: ImagesObserver
About: Author
Joe Gornick
*/
/*
Class: ImagesObserver
@sindre
sindre / gist:558771
Created August 31, 2010 09:08 — forked from remy/gist:330318
autofocus and placeholder support
/**
* Add this script to the end of your document that use <input autofocus type="text" />
* or <input type="text" placeholder="username" /> and it'll plug support for browser
* without these attributes
* Minified version at the bottom
*/
(function () {
function each(list, fn) {
var l = list.length;
@sindre
sindre / gist:593379
Created September 23, 2010 09:13 — forked from kaelig/gist:458477
HTML Newsletter - Make Outlook 2007+ behave with line-heights
// Make Outlook 2007+ behave with line-heights
element {
mso-line-height-rule:exactly;
-mso-line-height-rule:exactly;
}
@sindre
sindre / anzeige.html
Created November 29, 2010 11:09 — forked from botic/anzeige.html
<!-- Zweiter Versuch by @yatil --->
<!-- Nun auch mit Sprachauszeichnung. --->
<!-- Dritter Versuch by @sindrewimberger--->
<!-- Nun auch mit microformat. --->
<article class="vcard">
<hgroup>
<h2>Weitersagen!</h2>
<h1 class="note">Die führende <span lang="en">Social Media</span> Agentur Europas sucht:</h1>
</hgroup>
<ul>
@sindre
sindre / showcase.js
Created February 11, 2011 10:50
JS Coverflow
/**
Copyright (c) 2008 Victor Stanciu; contact [at] victorstanciu [dot] ro; http://www.victorstanciu.ro/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@sindre
sindre / gist:962201
Created May 9, 2011 07:37
JS createDocumentFragment to avoid reflow
// http://www.slideshare.net/nzakas/high-performance-javascript-amazon-devcon-2011
var list = document.getElementsByClassName('items')[0],
fragment = document.createDocumentFragment(),
i, item;
for (i=0; i < 10; i++) {
item = document.createElement('li');
item.innerHTML = 'item #'+i;
fragment.appenChild(item);
}
@sindre
sindre / mobile-meta-links.html
Created June 10, 2011 07:18
Mobile meta & links
@sindre
sindre / ipadlabels
Created June 21, 2011 15:00 — forked from anonymous/ipadlabels
iOS Label fix
var iPadLabels = function () {
function fix() {
var labels = document.getElementsByTagName('label'),
target_id,
el;
for (var i = 0; labels[i]; i++) {
if (labels[i].getAttribute('for')) {
labels[i].onclick = labelClick;
}
@sindre
sindre / mobile tags for your '<head>'
Created June 21, 2011 15:06 — forked from chuanxshi/mobile tags for your '<head>'
mobile tags for your '<head>'
<!doctype html>
<!-- Helpful things to keep in your <head/>
// Shi Chuan, https://github.com/shichuan/mobile-html5-boilerplate
-->
<head>
<!-- consider using below meta tags if you want to disable format detection by default -->
<meta name="format-detection" content="telephone=no"/>
<meta name="format-detection" content="address=no"/>
<!-- consider using below link tag if the page is duplicate content of a desktop version -->