Skip to content

Instantly share code, notes, and snippets.

View vphat28's full-sized avatar
🏠
Working from home

Xavi Nguyen vphat28

🏠
Working from home
View GitHub Profile
add_filter('mepr_stripe_checkout_session_args', function ($args) {
$args['shipping_address_collection'] = [
// Specify which shipping countries Checkout should provide as options for shipping locations
'allowed_countries' => ['AU', 'GB', 'NZ', 'US'],
];
$args['payment_method_types'][] = 'afterpay_clearpay';
return $args;
});
#include <stdio.h>
#include <mpi.h>
#include <ctime>
#define nra 620 /* Số hàng của ma trận A */
#define nca 150 /* Số cột của ma trận A */
#define ncb 7
int main(int argc, char** argv) {
clock_t start = clock();
#include <stdio.h>
#include "mpi.h"
#include <ctime>
#define nra 620 /* Số hàng của ma trận A */
#define nca 150 /* Số cột của ma trận A */
#define ncb 7
#define MASTER 0
#define FROM_MASTER 1 /* Kiểu message */
#define FROM_WORKER 2
MPI_Status status;
@vphat28
vphat28 / how-i-work-template.md
Created September 16, 2021 16:32 — forked from jazzsequence/how-i-work-template.md
Template for How I Like to Work posts

How I work

This is my own interpretation of how I like to work, feedback welcome! Especially if my own view of how I think I like to work doesn't match your experience of how it seems I like to work!

When I work

https://www.google.com/url?q=https://us02web.zoom.us/j/81252970165&sa=D&source=calendar&ust=1626188410853000&usg=AOvVaw04IDK-nxldx_tWL4SZ2Vm8
@vphat28
vphat28 / skyverge-php-engineer-code-review-1.php
Last active May 14, 2020 05:49
php-engineer-code-review-1.php
<?php
/**
* This code retrieves course data from an external API and displays it in the user's
* My Account area. A merchant has noticed that there's a delay when loading the page.
*
* == What changes would you suggest to reduce or remove that delay? ==
* - I would load courses and sso_link via ajax requests and display a friendly loading message when the requests are being processed.
*/
public function add_my_courses_section() {
global $current_user;
@vphat28
vphat28 / Data.php
Created May 18, 2019 14:41
Purolator Helper
<?php
namespace Purolator\Shipping\Helper;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\Encryption\EncryptorInterface;
use Magento\Store\Model\ScopeInterface;
use Magento\Store\Model\StoreManagerInterface;
class Data
defination of uicomponents
module-ui/view/base/requirejs-config.js
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
var config = {
paths: {
'ui/template': 'Magento_Ui/templates'
@vphat28
vphat28 / test.phtml
Last active January 4, 2019 08:36
Example - define and configure ui_component in template file
<?php
/** @var \Purolator\Shipping\Block\Adminhtml\ChangeOrigin $block */
$settings = $block->getOriginSettings();
$countryCollection = $settings['countryCollection'];
$regionCollection = $block->getRegionCollection();
$currentRegion = null;
$currentCountryId = $settings['country']->getId() !== null ? $settings['country']->getId() : 'US';
$regionDictionary = [];
foreach ($regionCollection as $region) {
@vphat28
vphat28 / gist:50b81a8f9c7ec90adfd64033f920ff3f
Created May 17, 2017 14:07
Install mod_pagespeed with nginx
bash <(curl -f -L -sS https://ngxpagespeed.com/install) \
--nginx-version latest \
-v latest-stable \
-y \
--additional-nginx-configure-arguments ' --with-cc-opt="-g -O2 -fdebug-prefix-map=/build/nginx-fTQkOt/nginx-1.10.1=. -fPIE -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2" --with-ld-opt="-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now" --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-ipv6 --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_addition_module --with-http