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
/**
* 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*/
@ifthenelse
ifthenelse / favicon.php
Last active April 22, 2021 22:33
favicon html code for all browsers (got from http://www.sitepoint.com/favicon-a-changing-role/ )
<?php $favicon_path = "/docroot/img/ico/"; ?>
<!-- Default -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?>favicon.ico"/>
<!-- For IE6+ -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?><?php echo $favicon_path; ?>favicon.ico" type="image/x-icon">
<!-- For IE6+ -->
<link rel="shortcut icon" href="<?php echo $favicon_path; ?>favicon.ico">
@ifthenelse
ifthenelse / whichTransitionEvent.js
Last active December 16, 2015 12:18
Use modernizr to check CSS transitions events support: * 'WebkitTransition':'webkitTransitionEnd' (Chrome / Safari) * 'MozTransition':'transitionend' (Mozilla) * 'OTransition':'oTransitionEnd' (Opera) * 'transition':'transitionend' (Internet Explorer)
function whichTransitionEvent(){
var t;
var el = document.createElement('fakeelement');
var transitions = {
'transition':'transitionend',
'OTransition':'oTransitionEnd',
'MozTransition':'transitionend',
'WebkitTransition':'webkitTransitionEnd'
}
@ifthenelse
ifthenelse / gist:3974067
Created October 29, 2012 15:08
CSS Cross-browser opacity
opacity: .75;
filter: alpha(opacity=75);
-ms-filter: "alpha(opacity=75)";
-khtml-opacity: .75;
-moz-opacity: .75;
@ifthenelse
ifthenelse / setCSSClasses
Created July 9, 2012 09:47
A function to set CSS classes to an html element such as "first", "last", "odd", "even" and "active"
<?php
/* Sets classes such as "first", "last", "odd", "even" and "active"
* @param $articles An array of articles to count
* @param $index The index to watch for
* @param $currentArticle The index of the current article
* @return string
**/
function setCSSClasses($index = null, $articles = null, $currentArticle = null) {