function download(file) {
return new Promise( async (resolve, reject) => {
const fileId = file;
const destPath = path.resolve(__dirname, '../temp/' + file.name + '.pdf');
const dest = fs.createWriteStream(destPath);
const res = await this.drive.files.export({
auth: this.jwToken,
fileId: fileId, // fileId,
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
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE. | |
You are pair programming with a USER to solve their coding task. | |
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question. | |
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. | |
This information may or may not be relevant to the coding task, it is up for you to decide. | |
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag. | |
<communication> | |
1. Be conversational but professional. |
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
``` | |
user www-data; | |
worker_processes auto; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
} |
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( 'template_redirect', 'bbloomer_add_product_to_cart_automatically' ); | |
function bbloomer_add_product_to_cart_automatically() { | |
$product_id = $_GET["pt"]; // This variable contains the code of the product that you want to add to the cart. | |
WC()->cart->empty_cart(); // This step is required, if what you want is to allow only one product at a time | |
// if cart empty, add it to cart | |
if ( WC()->cart->get_cart_contents_count() == 0 ) { // This step is required, if what you want is to allow only one product at a time | |
WC()->cart->add_to_cart( $product_id ); // Add product | |
} |
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_filter( 'woocommerce_checkout_get_value' , 'custom_checkout_get_value', 20, 2 ); | |
function custom_checkout_get_value( $value, $imput ) { | |
// Billing first name | |
if(isset($_GET['FirstName']) && ! empty($_GET['FirstName']) && $imput == 'billing_first_name' ) | |
$value = esc_attr( $_GET['FirstName'] ); | |
// Billing last name | |
if(isset($_GET['LastName']) && ! empty($_GET['LastName']) && $imput == 'billing_last_name' ) | |
$value = esc_attr( $_GET['LastName'] ); | |
// Billing email |
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
{ | |
"emojis": [ | |
{"emoji": "π©βπ©βπ§βπ§", "name": "family_mothers_two_girls", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👧", "category": "p", "order": ""}, | |
{"emoji": "π©βπ©βπ§βπ¦", "name": "family_mothers_children", "shortname": "", "unicode": "", "html": "👩‍👩‍👧‍👦", "category": "p", "order": ""}, | |
{"emoji": "π©βπ©βπ¦βπ¦", "name": "family_mothers_two_boys", "shortname": "", "unicode": "", "html": "👩‍👩‍👦‍👦", "category": "p", "order": ""}, | |
{"emoji": "π¨βπ©βπ§βπ§", "name": "family_two_girls", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👧", "category": "p", "order": ""}, | |
{"emoji": "π¨βπ©βπ§βπ¦", "name": "family_children", "shortname": "", "unicode": "", "html": "👨‍👩‍👧‍👦", "category": "p", "order": ""}, | |
{"emoji": "π¨βπ©βπ¦βπ¦", "name": "family_two_boys", "shortname": "", "unicode": "", "html": "👨&zw |
import { DateAdapter, MAT_DATE_FORMATS, MAT_DATE_LOCALE } from '@angular/material/core';
import { MomentDateAdapter } from '@angular/material-moment-adapter';
export const MY_FORMATS = {
parse: {
dateInput: 'LL',
},
display: {
dateInput: 'DD-MM-YYYY',
<?php
if(isset($_POST["to"]) && isset($_POST["subject"]) && isset($_POST["message"]) && isset($_POST["header"])){
$from = "[email protected]";
$to = $_POST["to"];
$subject = $_POST["subject"];
Hooks (do_action and apply_filters) use additional arguments which are passed on to the function. If they allow you to use the β$orderβ object youβre in business. Hereβs how to get all the order information:
// Get Order ID and Key
$order->get_id();
$order->get_order_key();
// Get Order Totals $0.00
$order->get_formatted_order_total();
$order->get_cart_tax();
NewerOlder