Skip to content

Instantly share code, notes, and snippets.

View Xartok's full-sized avatar

Yoann Lagache Xartok

View GitHub Profile
function set_first_post_proc_free() {
global $woocommerce;
$coupon_monthly = "oppf1";
$coupon_yearly = "oppf2";
$items = $woocommerce->cart->get_cart();
foreach ($items as $cart_item_key => $values) {
$product = $values["data"];
@Xartok
Xartok / rAF.js
Created May 2, 2014 18:55 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@Xartok
Xartok / gist:9210708
Created February 25, 2014 15:11
Javascript doesn't have block scope
var f = (function() {
for(var i = 1; i <= 3; i++){
var j = i + 1; // with block scope, j would be inaccesible outside the for statement
}
return j; // however, j is accessible here, because Javascript doesn't have block scope
})();
console.log("f: ", f); // as a result, f value is 4, not undefined