Skip to content

Instantly share code, notes, and snippets.

View ifthenelse's full-sized avatar
🏎️
LIFE BE LIKE

Andrea Collet ifthenelse

🏎️
LIFE BE LIKE
View GitHub Profile
@ifthenelse
ifthenelse / jquery.getTransitionDuration.js
Last active September 4, 2018 09:13 — forked from mandelbro/jQuery-transitionend
Quick jQuery plugin to get the duration of a CSS transition for an element. Support multiple transition values
/**
* jQuery.getTransitionDuration
* A jQuery plugin to get transition-duration in milliseconds
* Works with multiple values and supports all browser vendor prefixes
*
* Usage with single transition-duration values $(div).getTsDuration()
* Usage with multiple transition-duration values $(div).getTsDuration("opacity") (otherwise would return the first)
*
* Based on a gist by Chris Montes https://gist.github.com/mandelbro/4067903
*/
alias nom='npm cache clean && rm -rf node_modules && mkdir node_modules && tmutil addexclusion $(pwd)/node_modules && touch node_modules/.metadata_never_index && npm install'
alias bom='bower cache clean && rm -rf bower_components && mkdir bower_components && tmutil addexclusion $(pwd)/bower_components && touch bower_components/.metadata_never_index && bower install'
@ifthenelse
ifthenelse / sticky.js
Last active August 29, 2015 14:10 — forked from chriskoelle/sticky.js
Add an affix behavior to an element, by keeping it sticky between 2 elements.
;(function($) {
$.fn.extend({
stickyWidget: function(options) {
// Exit if there are no elements to avoid errors:
if (this.length === 0) {
return this;
}
var settings = $.extend({
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Page title</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>
<body>
/**
* This casper scipt checks for 404 internal links for a given root url.
*
* Usage:
*
* $ casperjs 404checker.js http://mysite.tld/
* $ casperjs 404checker.js http://mysite.tld/ --max-depth=42
*/
/*global URI*/