Skip to content

Instantly share code, notes, and snippets.

View verteb's full-sized avatar

Dominic Simard verteb

View GitHub Profile
@verteb
verteb / gist:2062405
Created March 17, 2012 16:56
CSS: Image Replacement
.ir{
font: 0/0 a;
text-shadow: none;
color: transparent;
}
@verteb
verteb / gist:2062560
Created March 17, 2012 17:02
jQuery: Base Function
jQuery.noConflict();
(function($) {
$(document).ready(function() {
});
})(jQuery);
@verteb
verteb / gist:2065517
Created March 17, 2012 21:38
CSS: Better Helvetica
body {
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
}
@verteb
verteb / gist:2130011
Created March 20, 2012 02:02
PHP: get_current_page_url()
/**
* Retourne l'url de la page courante
* @return string
*/
function get_current_page_url(){
return (!empty($_SERVER['HTTPS'])) ? "https://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'] : "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
}
@verteb
verteb / gist:2130351
Created March 20, 2012 02:36
WordPress: Template Header
/*
Template Name: Offres d'emnploi
*/
@verteb
verteb / cycle-lite.js
Created March 20, 2012 13:25
jQUery: Cycle
;(function($){var ver='Lite-1.5';$.fn.cycle=function(options){return this.each(function(){options=options||{};if(this.cycleTimeout)clearTimeout(this.cycleTimeout);this.cycleTimeout=0;this.cyclePause=0;var $cont=$(this);var $slides=options.slideExpr?$(options.slideExpr,this):$cont.children();var els=$slides.get();if(els.length<2){window.console&&console.log('terminating; too few slides: '+els.length);return;}
var opts=$.extend({},$.fn.cycle.defaults,options||{},$.metadata?$cont.metadata():$.meta?$cont.data():{});var meta=$.isFunction($cont.data)?$cont.data(opts.metaAttr):null;if(meta)
opts=$.extend(opts,meta);opts.before=opts.before?[opts.before]:[];opts.after=opts.after?[opts.after]:[];opts.after.unshift(function(){opts.busy=0;});var cls=this.className;opts.width=parseInt((cls.match(/w:(\d+)/)||[])[1])||opts.width;opts.height=parseInt((cls.match(/h:(\d+)/)||[])[1])||opts.height;opts.timeout=parseInt((cls.match(/t:(\d+)/)||[])[1])||opts.timeout;if($cont.css('position')=='static')
$cont.css('position','relative
@verteb
verteb / gist:2135691
Created March 20, 2012 13:37
CSS: ClearFix
.clearfix:before, .clearfix:after { content: ""; display: table; }
.clearfix:after { clear: both; }
.clearfix { *zoom: 1; }
@verteb
verteb / corner.js
Created March 20, 2012 16:33
jQuery: Corner
(function(a){function l(a,b,c){switch(a){case"round":return Math.round(c*(1-Math.cos(Math.asin(b/c))));case"cool":return Math.round(c*(1+Math.cos(Math.asin(b/c))));case"sharp":return c-b;case"bite":return Math.round(c*Math.cos(Math.asin((c-b-1)/c)));case"slide":return Math.round(c*Math.atan2(b,c/b));case"jut":return Math.round(c*Math.atan2(c,c-b-1));case"curl":return Math.round(c*Math.atan(b));case"tear":return Math.round(c*Math.cos(b));case"wicked":return Math.round(c*Math.tan(b));case"long":return Math.round(c*Math.sqrt(b));case"sculpt":return Math.round(c*Math.log(c-b-1,c));case"dogfold":case"dog":return b&1?b+1:c;case"dog2":return b&2?b+1:c;case"dog3":return b&3?b+1:c;case"fray":return b%2*c;case"notch":return c;case"bevelfold":case"bevel":return b+1;case"steep":return b/2+1;case"invsteep":return(c-b)/2+1}}function k(b){while(b){var c=a.css(b,"backgroundColor"),d;if(c&&c!="transparent"&&c!="rgba(0, 0, 0, 0)"){if(c.indexOf("rgb")>=0){d=c.match(/\d+/g);return"#"+j(d[0])+j(d[1])+j(d[2])}return c}if(b.nodeNam
@verteb
verteb / gist:2150010
Created March 21, 2012 17:40
Wordpress: Widget
class FacebookFeed extends WP_Widget {
function facebookFeed()
{
parent::WP_Widget(false, $name = 'facebookFeed', array("description" => 'Affiche le fil d\'actualités facebook'));
}
function widget($args, $instance)
{
@verteb
verteb / gist:2237941
Created March 29, 2012 14:24
HTML: Empty html5 file
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
</body>
</html>