This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Easing { | |
// Based on https://github.com/danro/jquery-easing/blob/master/jquery.easing.js | |
/** | |
* @param {number} t - Current Time | |
* @param {number} b - Start Value | |
* @param {number} c - Target Value | |
* @param {number} d - Duration | |
*/ | |
static easeInQuad(t: number, b: number, c: number, d: number): number { | |
return c * (t /= d) * t + b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ob_html_compress($buf){ | |
return preg_replace(array('/<!--(.*)-->/Uis',"/[[:blank:]]+/"),array('',' '),str_replace(array("\n","\r","\t"),'',$buf)); | |
} | |
// Usage | |
ob_start('ob_html_compress'); | |
get_header(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Number.prototype.map = function (in_min, in_max, out_min, out_max) { | |
return (this - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('restrict_manage_posts','create_lists'); | |
function create_lists() { | |
global $typenow; | |
$filters_arr = array(); | |
// In which page do you want the filters to display, | |
// $filters_arr = array("emploi"); | |
if(in_array($typenow, $filters_arr)){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function($){ | |
$.fn.setHeight = function(affectChildren){ | |
if (typeof affectChildren === "undefined" || affectChildren===null) affectChildren = false; | |
var height = []; | |
this.each(function(){ | |
if(affectChildren){ | |
height = []; | |
$(this).children().each(function(){ | |
height.push($(this).outerHeight()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hwl_home_pagesize( $query ) { | |
global $allposts,$latestpost; | |
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1; | |
if(CONDITION){ | |
$query->query_vars['posts_per_page']=1; | |
$query->query_vars['paged'] = $paged; | |
return; | |
} |