- tạo payment request
let paymentReq = new PaymentRequest([paymentMethod], details, options)
paymentMethod
: app defineddetails
: popup for user selectoptions
: app defined
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
-- [[ set tmux window name by workspace ]] | |
local vimenter_group = vim.api.nvim_create_augroup("UserVimEnter", { clear = true }) | |
vim.api.nvim_create_autocmd("VimEnter", { | |
group = vimenter_group, | |
callback = function() | |
local is_term_tmux = vim.env.TERM_PROGRAM == "tmux" | |
if not is_term_tmux then return end | |
local function get_last_directory(path) | |
path = path:gsub("[/\\]+$", "") -- Remove trailing slashes | |
return path:match("([^/\\]+)$") -- Capture the last directory name |
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
local function on_attach(bufnr) | |
local api = require("nvim-tree.api") | |
local core = require("nvim-tree.core") | |
local utils = require("nvim-tree.utils") | |
-- NOTE: set nvim-tree.ui.confirm.remove = false to take effect | |
local function remove_range_nodes() | |
local nodes = utils.get_nodes_by_line(api.tree.get_nodes().nodes, core.get_nodes_starting_line()) | |
local lines = {} | |
if vim.fn.mode() == "v" or vim.fn.mode() == "V" then |
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 DESIGN | |
Requirement: | |
- not change source object | |
Features: | |
- mapping | |
- include/exclude |
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
use('test'); | |
const aggregation = [ | |
// 32. Write a MongoDB query to find the restaurant name, borough, longitude and latitude and cuisine for those restaurants which contain 'Mad' as first three letters of its name. Go to the editor | |
// 31. Write a MongoDB query to find the restaurant name, borough, longitude and attitude and cuisine for those restaurants which contains 'mon' as three letters somewhere in its name. Go to the editor | |
// 30. Write a MongoDB query which will select the restaurant Id, name and grades for those restaurants which returns 0 as a remainder after dividing the score by 7. Go to the editor |
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
let canvas = document.querySelector('#canvas'); // id of canvas element | |
let ctx = canvas.getContext('2d') | |
ctx.lineWidth = 10; | |
ctx.lineCap = "round" | |
let process = 0 | |
let middle = canvas.width * 0.5; | |
function draw(process) { | |
console.log(process) |
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
/* | |
USE LIBRARY | |
*/ | |
// b1: use library LiquidCrystal | |
#import <LiquidCrystal.h> | |
// b2: khởi tạo biến chứa thông tin các pin | |
// chọn 1 trong các khởi tạo sau: |
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
import {app, BrowserWindow, net} from 'electron'; | |
function _setup() { | |
// ... | |
/** get data for app */ | |
let _strResult = ''; | |
let jsonResult; | |
let req = net.request({url: 'https://jsonplaceholder.typicode.com/users'}) | |
.on('response', res => { |
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
openssl req -sha256 -nodes -newkey rsa:2048 -nodes -keyout myserver.key -out server.csr -subj "/C=GB/ST=Yorks/L=York/O=MyCompany Ltd./OU=IT/CN=mysubdomain.mydomain.com" |
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
{"lastUpload":"2021-05-01T20:02:30.246Z","extensionVersion":"v3.4.3"} |