This file contains hidden or 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
var m = require('ti.paypal'); | |
var appID = 'MY-LIVE-APP-ID'; // live App ID | |
var env = m.PAYPAL_ENV_LIVE; // live | |
var recip = '[email protected]'; // live | |
var btn = m.createPaypalButton({ | |
// NOTE: height/width only determine the size of the view that the button is embedded in - the actual button size | |
// is determined by the buttonStyle property! | |
width : 278, | |
height : 60, |
This file contains hidden or 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
#!/usr/bin/env perl | |
package FormValidator::Lite::Constraint::MyVal; | |
use strict; | |
use warnings; | |
use FormValidator::Lite::Constraint; | |
use Data::Dumper; | |
rule 'CHECKBOX' => sub{ | |
my $ages = $_; |
This file contains hidden or 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
#!/usr/bin/env perl | |
package MyValidator; | |
use strict; | |
use warnings; | |
use FormValidator::Lite::Constraint; | |
use Data::Dumper; | |
rule 'CHECKBOX' => sub{ | |
my $ages = $_; |
This file contains hidden or 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
class My_Wc_Cart | |
{ | |
protected $logger; | |
public function __construct() | |
{ | |
$this->logger = new WC_Logger(); | |
add_action('woocommerce_cart_calculate_fees', [$this, 'check_fees'], 10, 1); | |
} |
This file contains hidden or 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 問い詰める() | |
{ | |
static $c = 0; | |
if ($c >= 3) { | |
return "実は私がやりました"; | |
} | |
$c++; | |
} |
This file contains hidden or 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
add_action('woocommerce_cart_tax_totals', 'check_taxes', 10, 2); | |
function check_taxes($tax_total, $cart) | |
{ | |
foreach($tax_totals as $k=>$v) { | |
// Do translate all labels via wp-content/languages/plugins/woocommerce-ja.mo | |
$v->label = __($v->label, 'woocommerce'); | |
} | |
return $tax_totals; | |
} |
This file contains hidden or 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 | |
class MyPayment | |
{ | |
protected static cards_config = [ | |
[ | |
'type' => 'visaelectron', | |
'patterns' => [4026, 417500, 4405, 4508, 4844, 4913, 4917], | |
'format' => '/(\d{1,4})/', | |
'length' => [16], |
This file contains hidden or 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 :: Bug #73322 :: mb_convert_variables detects recursive reference incorrectly ]( https://bugs.php.net/bug.php?id=73322 ) | |
$ php -v | |
PHP 7.1.0 (cli) (built: Dec 1 2016 08:13:15) ( NTS ) | |
$ php -r '$x = ["a", "b"]; mb_convert_variables("UTF-8", "SJIS,EUC-JP", $x);' | |
PHP Warning: mb_convert_variables(): Cannot handle recursive references in Command line code on line 1 |
This file contains hidden or 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 | |
// woocommerceテンプレート呼び出しをフックする | |
add_filter('wc_get_template', 'my_wc_get_template', 10, 5); | |
function my_wc_get_template($located, $template_name, $args, $template_path, $default_path) | |
{ | |
// 変更したいテンプレートを指定する | |
$templates = [ | |
'myaccount/form-login.php', |
This file contains hidden or 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
#!/bin/sh | |
curl "http://elections.huffingtonpost.com/pollster/api/charts/2016-general-election-trump-vs-clinton.csv" > ~/test.csv |
OlderNewer