Skip to content

Instantly share code, notes, and snippets.

View JosephSilber's full-sized avatar

Joseph Silber JosephSilber

View GitHub Profile
@JosephSilber
JosephSilber / dabblet.css
Created November 18, 2012 20:12
Relatively-position elements only fire events where they're actually painted
/**
* Relatively-position elements only fire events where they're actually painted
*/
body {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
.relative {
@JosephSilber
JosephSilber / jquery.scrollto.js
Created October 7, 2012 16:22
jQuery plugin to scroll to an element on the page
// jQuery plugin to scroll to an element on the page
// Usage: $('#someElement').scrollTo();
// or: $('#someElement').scrollTo(750);
(function($)
{
var $window = $(window),
$document = $(document),
$documentWrapper = $('body, html');
@JosephSilber
JosephSilber / handlebars.object_helpers.js
Created October 3, 2012 20:34 — forked from strathmeyer/handlebars.object_helpers.js
Handlebars.js helpers to iterate over objects
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, options) {
var buffer = "",
key;
@JosephSilber
JosephSilber / dabblet.css
Created February 28, 2012 19:32
CSS Pac-Man
/* CSS Pac-Man */
#pacman {
width: 1px;
height: 1px;
border: 60px solid red;
border-right-color: transparent;
border-radius: 50%;
}
@JosephSilber
JosephSilber / dabblet.css
Created February 23, 2012 19:46
Center wide image
/* Center wide image */
html, body, #container {
height: 100%;
}
#container {
width: 200px;
margin: 0 auto;
background: #ffd2be;
@JosephSilber
JosephSilber / dabblet.css
Created February 23, 2012 00:52
CSS diamond without transforms
/* CSS diamond without transforms */
#diamond {
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom: 70px solid red;
position: relative;
}
#diamond:after {
@JosephSilber
JosephSilber / dabblet.css
Created February 23, 2012 00:48
CSS diamond with flat top
/* CSS diamond with flat top */
#diamond {
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom: 20px solid red;
position: relative;
}
#diamond:after {
@JosephSilber
JosephSilber / dabblet.css
Created February 22, 2012 18:03
CSS diamond without transforms
/* CSS diamond without transforms */
#diamond {
width: 0;
height: 0;
border: 50px solid transparent;
border-bottom-color: red;
position: relative;
}
#diamond:after {