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
# block WP requests | |
RewriteCond %{THE_REQUEST} /(wp-content|wp-admin|wp-includes|wp-login) [NC] | |
RewriteRule ^(.*)$ - [F,L] |
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
<template> | |
<div class="p-4 bg-gray-900">Hello from Gist!</div> | |
</template> |
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
// A simple product with maximum available quantity. | |
GumCart.addItem({ | |
id: "HEADPHONES", // optional | |
name: "Wireless Headphones", // required | |
price: 89, // required | |
max_quantity: 2, | |
image: | |
"https://gumcart.com/images/products/product-1.jpg", | |
}); | |
// open the cart |
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 strict'; | |
const toRadians = degrees => (Math.PI / 180) * degrees; | |
const toDegrees = radians => (180 * radians) / Math.PI; | |
const earthRadius = 6371e3; // metres | |
module.exports.getDistance = (ne_lat, sw_lat, ne_lng, sw_lng) => { | |
var lat1 = toRadians(ne_lat); | |
var lat2 = toRadians(sw_lat); | |
var lat_diff = toRadians(sw_lat - ne_lat); |
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
for bucket in $(aws s3api list-buckets --query "Buckets[].Name" --output text); do echo $bucket | |
aws s3api list-objects --bucket $bucket --output json --query "[sum(Contents[].Size), length(Contents[])]"; done |
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
/* | |
* Copyright (C) 2015 Pavel Savshenko | |
* Copyright (C) 2011 Google Inc. All rights reserved. | |
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | |
* Copyright (C) 2008 Matt Lilek <[email protected]> | |
* Copyright (C) 2009 Joseph Pecoraro | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: |
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
<?php | |
array ( | |
'sitemap.xml' => 'index.php?aiosp_sitemap_path=root', | |
'(.+)-sitemap(\\d+).xml' => 'index.php?aiosp_sitemap_path=$matches[1]&aiosp_sitemap_page=$matches[2]', | |
'(.+)-sitemap.xml' => 'index.php?aiosp_sitemap_path=$matches[1]', | |
'^wp-json/?$' => 'index.php?rest_route=/', | |
'^wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]', | |
'^index.php/wp-json/?$' => 'index.php?rest_route=/', | |
'^index.php/wp-json/(.*)?' => 'index.php?rest_route=/$matches[1]', | |
'listings/?$' => 'index.php?post_type=property', |
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 strict'; | |
var puppeteer = require('puppeteer'); | |
module.exports.pptr = async (event, context) => { | |
puppeteer.launch().then(async browser => { | |
const page = await browser.newPage(); |
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
var dz = new Dropzone('#dropzone-uploader', { | |
url: '/admin/media/upload', | |
acceptedFiles: 'image/jpeg', | |
method: 'put', | |
maxFilesize: 2, | |
parallelUploads: 1, | |
uploadMultiple: false, | |
createImageThumbnails: false, | |
autoProcessQueue: false, | |
previewTemplate: $('#preview-template').html(), |
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 strict'; | |
var axios = require('axios'), | |
oauth = require('oauth-sign'), | |
qs = require('querystring'), | |
config = require('./config.json'); | |
// read config | |
var $woo = config.woo; | |
module.exports.woo = async (event, context) => { |
NewerOlder