Skip to content

Instantly share code, notes, and snippets.

View yckart's full-sized avatar

Yannick Albert yckart

View GitHub Profile
@iambibhas
iambibhas / scopes.txt
Last active January 25, 2025 20:07
Sublime Text 2: Snippet scopes
Here is a list of scopes to use in Sublime Text 2 snippets -
ActionScript: source.actionscript.2
AppleScript: source.applescript
ASP: source.asp
Batch FIle: source.dosbatch
C#: source.cs
C++: source.c++
Clojure: source.clojure
CoffeeScript: source.coffee
@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 ===============================
@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];
@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;
}
});
@rnmp
rnmp / ABOUT.md
Created September 23, 2012 02:06
DATA-COLUMNS

For more information about this project, follow this link.

@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>';
@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.

@sdepold
sdepold / LICENSE.txt
Created August 15, 2012 05:50 — forked from 140bytes/LICENSE.txt
140byt.es -- addObserverMethods
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Sascha Depold http://depold.com
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
@ziadoz
ziadoz / scrape.php
Created August 13, 2012 21:54
Scraping Google using PHP and Goutte:
<?php
/**
* Todo: Send a random user agent string and sleep a random amount between requests.
*/
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
// Extract and sanatize input:
$domain = filter_input(INPUT_POST, 'domain', FILTER_SANITIZE_URL);
$terms = filter_input(INPUT_POST, 'terms', FILTER_SANITIZE_STRING);
// Setup Goutte (which also includes Guzzle):
@chrisl8888
chrisl8888 / 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;