Skip to content

Instantly share code, notes, and snippets.

View andreruffert's full-sized avatar

André Ruffert andreruffert

View GitHub Profile
@andreruffert
andreruffert / mixins.less
Created March 28, 2011 13:49
LESS CSS mixins Collection
.border-radius(@radius:15px)
{
-webkit-border-radius:@radius;
-moz-border-radius:@radius;
border-radius:@radius;
}
.multi-rounded-corners(@topLeft: 5px, @topRight: 5px, @bottomRight: 5px, @bottomLeft: 5px)
{
-webkit-border-radius: @topLeft @topRight @bottomRight @bottomLeft;
@andreruffert
andreruffert / jquery.uberCheckbox.js
Created April 15, 2011 13:43
jquery.uberCheckbox.js
(function($){
$.fn.uberCheckbox = function(options){
// Default On / Off labels:
options = $.extend({
labels : ['ON','OFF']
},options);
return this.each(function(){
@andreruffert
andreruffert / jquery.uberSelect.js
Created April 15, 2011 13:48
jquery.uberSelect.js
(function($){
$.fn.uberSelect = function(options){
options = $.extend({
render : function(option){
return $('<li>',{
html : option.text()
});
},
className : ''
@andreruffert
andreruffert / gist:930770
Created April 20, 2011 08:55
Automatically updating Timestamps. Facebook style.
function timeago($timestamp)
{
$distance = ( round( abs( time() - $timestamp ) / 60 ) );
switch($distance):
case <= 1:
$return = ($distance == 0) ? 'less than a minute ago' : '1 minute ago';
break;
case < 60:
$return = $distance . ' minutes ago';
@andreruffert
andreruffert / gist:1014137
Created June 8, 2011 10:02
CSS Text Shadows
/* Basic Shadow */
h1 {
text-shadow: 2px 4px 3px rgba(0,0,0,0.3);
}
/* Quick and Dirty Letterpress */
h1 {
color: rgba(0,0,0,0.6);
text-shadow: 2px 2px 3px rgba(255,255,255,0.1);
}
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
@andreruffert
andreruffert / gist:1405568
Created November 29, 2011 17:13
Warning Duplicate IDs
$('[id]').each(function()
{
var ids = $('[id='+this.id+']');
if(ids.length>1 && ids[0]==this)
{
alert('Multiple IDs #'+this.id);
}
});
@andreruffert
andreruffert / gist:1407159
Created November 29, 2011 23:33
Super Mario :)
______██████████████
-____██▓▓▓▓▓▓▓▓▓ L ▓████
-__██▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓██
-__██████░░░░██░░██████
██░░░░████░░██░░░░░░░░██
██░░░░████░░░░██░░░░░░██
-__████░░░░░░██████████
-__██░░░░░░░░░░░░░██
_____██░░░░░░░░░██
-______██░░░░░░██
@andreruffert
andreruffert / dabblet.css
Created January 5, 2012 14:59
Styling a label of a checked checkbox
input[type=checkbox] + label:before{
content: "Please check the checkbox.";
}
input[type=checkbox]:checked + label:before{
content: "Thanks! :)";
}
input[type=checkbox] {
display: none;
}
input[type=checkbox] + label:before{
display: block;
content: "";
width:10px;
height:10px;
line-height: 10px;
padding: 3px;