Skip to content

Instantly share code, notes, and snippets.

View lincetto's full-sized avatar

Andrea Lincetto lincetto

View GitHub Profile
@dabit3
dabit3 / Router.vue
Last active December 4, 2023 21:36
Using AWS Amplify Vue with routing
const router = new Router({
routes: [
{
path: '/',
name: 'Home',
component: Home,
meta: { requiresAuth: true}
},
{
path: '/notes',
@mendhak
mendhak / apigateway.tf
Last active April 24, 2024 10:52
Terraform - API Gateway with greedy path (proxy+) calling httpbin. Also includes deployment
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {
@maxkostinevich
maxkostinevich / functions.php
Last active February 11, 2023 20:03
WordPress: Export custom data to CSV
<?php
/**
* Export Data to CSV file
* Could be used in WordPress plugin or theme
*/
// A sample link to Download CSV, could be placed somewhere in plugin settings page
?>
<a href="<?php echo admin_url( 'admin.php?page=myplugin-settings-page' ) ?>&action=download_csv&_wpnonce=<?php echo wp_create_nonce( 'download_csv' )?>" class="page-title-action"><?php _e('Export to CSV','my-plugin-slug');?></a>
@daltonrooney
daltonrooney / paypal_sub_exclude_woocom.php
Last active November 11, 2021 08:34
Exclude PayPal gateway for WooCommerce subscriptions
/* $productCategoryID includes all subscription products */
function cart_includes_subscription_category() {
$productCategoryID = 10;
global $woocommerce;
$product_in_cart = false;
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) :
$_product = $values['data'];
$terms = get_the_terms( $_product->id, 'product_cat' );
if ( $terms ) :
foreach ($terms as $term) :
@cheeaun
cheeaun / js-error-logging-services.md
Last active December 10, 2023 13:04
JavaScript error logging services