Skip to content

Instantly share code, notes, and snippets.

View jkiss's full-sized avatar
🪐
universe of 1,000,000,000 universes

百里(Mr.B) jkiss

🪐
universe of 1,000,000,000 universes
View GitHub Profile
@jkiss
jkiss / rAF_polyfill.md
Last active May 8, 2017 02:07
Front End common code
// rAF poilyfill
; (function () {
  var lastTime = 0,
    vendors = ['webkit', 'moz'];
  for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
    window.requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
    window.cancelAnimationFrame = window[vendors[x] + 'CancelAnimationFrame'] || window[vendors[x] + 'CancelRequestAnimationFrame'];
  }
 if (!window.requestAnimationFrame)
<?php
//woocommerce中文网关支持paypal
// details at http://devework.com/support-paypal-gateway-in-woocommerce.html
//本函数解决的问题:贝宝不支持你的商铺货币。Gateway Disabled: PayPal does not support your store's currency.
add_filter( 'woocommerce_paypal_supported_currencies', 'enable_custom_currency' );
function enable_custom_currency($currency_array) {
$currency_array[] = 'CNY';
return $currency_array;
}