Skip to content

Instantly share code, notes, and snippets.

View yckart's full-sized avatar

Yannick Albert yckart

View GitHub Profile
@chrisjlee
chrisjlee / output.css
Created August 2, 2012 21:25 — forked from aquelito/output.css
SCSS Compass Font Size - Vertical Rhythm
html {
font: 100%/1.5em "Helvetica Neue", Helvetica, Arial, sans-serif; }
h1, .h1 {
font-size: 4em;
line-height: 1.5em;
margin: 0.5em 0; }
h2, .h2 {
font-size: 3em;
@devinrhode2
devinrhode2 / idea.md
Created September 3, 2012 07:41
Idea for class getter/setter hooks for jQuery

Introduction:

First, checkout Animate.css

Don't continue until you've checked it out. Go, go now.

Now, consider actually using this, you do: $('#button').addClass('pulse')

This css class uses modern css3 for all it's magic, but flat out won't work (to my knowledge) on older browsers.

@quangbahoa
quangbahoa / breadcrumb.php
Created September 7, 2012 15:57
Custom WP breadcrumbs
<?php
/*
Custom breadcrumbs
*/
function wp_breadcrumbs(){
$delimiter = '&raquo;';
$name = 'Home';
$currentBefore = '<span class="current">';
$currentAfter = '</span>';
@yumitsu
yumitsu / gist:3782934
Created September 25, 2012 16:24
jQuery scroller, like bootstrap scrollspy
$(document).ready(function(){
var lastId, topMenu = $("#navbar-scroll"),
topMenuHeight = topMenu.outerHeight() + 150,
menuItems = topMenu.find("a"),
scrollItems = menuItems.map(function() {
var item = $($(this).attr("href"));
if (item.length) {
return item;
}
});
@hay
hay / has-overflow-scrolling.js
Created November 7, 2012 16:14
Check if a browser supports the overflow-scrolling CSS property, optionally with a prefix
function hasOverflowScrolling() {
var prefixes = ['webkit', 'moz', 'o', 'ms'];
var div = document.createElement('div');
var body = document.getElementsByTagName('body')[0];
var hasIt = false;
body.appendChild(div);
for (var i = 0; i < prefixes.length; i++) {
var prefix = prefixes[i];
@desandro
desandro / transition-scroll-to.js
Created December 4, 2012 16:50
Use CSS transitions to scroll to element
( function( window, undefined ) {
'use strict';
// helper function
function capitalize( str ) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
// ========================= getStyleProperty by kangax ===============================
module.exports = function(redisClient,prefix) {
var Autocomplete = {};
Autocomplete.prefix = prefix;
Autocomplete.terminal = "+";
Autocomplete.add = function(word, next) {
function add(letters, key, last, x) {
var letter = last ? Autocomplete.terminal : letters[x];
var score = last ? 0 : letter.charCodeAt(0);
@ZeeAgency
ZeeAgency / gist:5249740
Last active December 15, 2015 10:59
Different "pointing" unicode characters
Black pointing triangles
White pointing triangles
@stowball
stowball / nth-child-examples.scss
Last active December 18, 2015 01:29
Poor man's nth-child mixin for LT IE9. It supports single (X), repeating (Xn), repeating starting from an index (Xn+Y / Xn-Y) and odd & even. View a live demo here: http://codepen.io/stowball/pen/GxlIc
.selected {
background: #000;
color: #fff;
}
.even > li:first-child {
@include nth-child(even, 'li') {
@extend .selected;
}
}
@barneycarroll
barneycarroll / jquery.getLines.js
Last active December 29, 2015 02:51
Count the number of lines of text in a given element.
void function $getLines($){
function countLines($element){
var lines = 0;
var greatestOffset = void 0;
$element.find('character').each(function(){
if(!greatestOffset || this.offsetTop > greatestOffset){
greatestOffset = this.offsetTop;
++lines;
}