Skip to content

Instantly share code, notes, and snippets.

View stryju's full-sized avatar

tomasz stryjewski stryju

  • Meta
  • Kailua, HI
  • 09:30 (UTC -10:00)
View GitHub Profile
// hey there! ;-)
(function() {
var doc = document,
body = doc.body,
atan2 = Math.atan2,
cos = Math.cos,
sin = Math.sin,
sqrt = Math.sqrt,
@stryju
stryju / _normalize.scss
Created August 16, 2012 09:57
custom normalize
/*! normalize.css v1.0.0 | MIT License | git.io/normalize */
/*
* usage:
* @import "normalize";
*
* // this will print out ALL selectors
* @include normalize();
*
* // this will print out minimal set (*) -- you can see the list of "excluded" tags below
@stryju
stryju / minimold.js
Created July 6, 2012 10:58
mini-templating engine ( minimold ) - uses {{single_replace}} and {{iterator}}...{{/iterator}} from some ELEMENT
/*
* usage:
*
* tmpl( id_of_template_source:string , [template_data:object] );
*
*/
var minimold = (function(){
"use strict";
var cache = {};
@stryju
stryju / gist:2814801
Created May 27, 2012 15:33
add favicon to anchor tags via css
// 1st of all - enhance $.unique, so it works for normal arrays
// via http://paulirish.com/2010/duck-punching-with-jquery/
(function($){
var _old = $.unique;
$.unique = function(arr){
// do the default behavior only if we got an array of elements
if (!!arr[0].nodeType){
return _old.apply(this,arguments);
} else {
// reduce the array to contain no dupes via grep/inArray
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}