Skip to content

Instantly share code, notes, and snippets.

Avatar
💡
converting ideas to code

Roni Nes FLasH3r

💡
converting ideas to code
View GitHub Profile
@LeaVerou
LeaVerou / dabblet.css
Created May 6, 2014
Demo of shape-outside: border-box; by Lea Verou
View dabblet.css
/*
Demo of shape-outside: border-box; by Lea Verou
Original CSS Shapes demo by Sara Soueidan
*/
@import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400);
.demo {
margin: 50px auto;
width: 100%;
View Cookie.js
@rixth
rixth / gist:1088478
Created Jul 18, 2011
jquery bookmarklet
View gist:1088478
/**
* This is a template bookmarklet that loads jQuery. Also works
* if another library has defined $ itself.
*/
(function () {
var s = document.createElement('script');
s.setAttribute('src', 'http://jquery.com/src/jquery-latest.js');
s.onload = function () {
jQuery.noConflict();
@geuis
geuis / whenthen.js
Created Jul 30, 2011
When-Then (pseudo javascript Promise)
View whenthen.js
var when = function(){
if( !(this instanceof when) ) return new when(arguments); //return new instance of itself
var self = this; //cached so the syntax of code within the function is more readable
self.pending = Array.prototype.slice.call(arguments[0]); //convert arguments passed in to array
self.pending_length = self.pending.length; //cache length of the arguments array
self.results = []; //container for results of async functions
(function(){ // define pass() within this context so that the outer scope of self(this) is available when pass() is executed within the user's async functions
@leecade
leecade / LICENSE.txt
Created Oct 8, 2011 — forked from jed/LICENSE.txt
map properties for arrays and objects
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@zhephree
zhephree / framed.html
Created Feb 17, 2012
Cross-domain Self-resizing IFRAME
View framed.html
<html>
<head></head>
<body onload="iframeResizePipe()">
<iframe id="helpframe" src='' height='0' width='0' frameborder='0'></iframe>
<script type="text/javascript">
function iframeResizePipe()
{
// What's the page height?
var height = document.body.scrollHeight;
View clearfix.css
.clearfix{ zoom: 1;}
.clearfix:before, .clearfix:after{ content: ""; display: table;}
.clearfix:after { clear: both;}
@hapticdata
hapticdata / animator.js
Created Mar 29, 2012
simplified animation using requestAnimationFrame with onComplete, stop and resume
View animator.js
/**
* animator factory for creating requestAnimationFrame callbacks
* and simplifying their cancellation. Includes Erik Moller polyfill
* @author Kyle Phillips
* @example
* animator(function(){
* //do this every time
* if(Math.random() > 0.9){
* this.complete();
* }
@michael-e
michael-e / Example
Created Apr 7, 2012 — forked from designermonkey/Example
Wildcard Subdomains
View Example
# Define specified subdomains first
<VirtualHost *:80>
ServerName subdomain.domain.com
DocumentRoot "/path/to/domain.com/subdomains/subdomain"
</VirtualHost>
# Define domain and wildcard subdomains second
<VirtualHost *:80>
ServerName domain.com
DocumentRoot "/path/to/domain.com/httpdocs"
@davidwaterston
davidwaterston / Javascript now() function
Created Jun 24, 2012
A cross-browser Javascript shim function to return the number of milliseconds elapsed since either the browser navigationStart event (using performance.now or browser equivalent) or the UNIX epoch, depending on availability.
View Javascript now() function
var now = (function() {
// Returns the number of milliseconds elapsed since either the browser navigationStart event or
// the UNIX epoch, depending on availability.
// Where the browser supports 'performance' we use that as it is more accurate (microsoeconds
// will be returned in the fractional part) and more reliable as it does not rely on the system time.
// Where 'performance' is not available, we will fall back to Date().getTime().
// jsFiddle: http://jsfiddle.net/davidwaterston/xCXvJ