Skip to content

Instantly share code, notes, and snippets.

View AndresReyesDev's full-sized avatar
🥣
Cooking the Internet Soup since 1999…

Andrés Reyes Galgani AndresReyesDev

🥣
Cooking the Internet Soup since 1999…
View GitHub Profile
@AndresReyesDev
AndresReyesDev / Transantiago public endpoints.md
Created July 15, 2017 05:45 — forked from radutzan/Transantiago public endpoints.md
APIs REST públicas con data del Transantiago. Respuestas en JSON.

Importante

Transantiago implementó estas APIs para uso interno, por lo que no hay ninguna garantía sobre su funcionalidad, mantenimiento o futura existencia. Úsalas bajo tu propio riesgo. (Probablemente no es aconsejable que las uses para nada crítico.)

Paraderos alrededor de un punto

http://www.transantiago.cl/restservice/rest/getpuntoparada?lat=-33.6089714&lon=-70.5742975&bip=1

Estimación de parada

http://www.transantiago.cl/predictor/prediccion?codsimt=PA420&codser=504 (código de servicio es opcional, pero el parámetro debe estar presente aunque esté vacío)

Lista de servicios

@AndresReyesDev
AndresReyesDev / get-order-detail-by-order-id.php
Created December 26, 2017 16:25 — forked from web-hat/get-order-detail-by-order-id.php
Works with WooCommerce 3.x or above
<?php
if (!function_exists('getOrderDetailById')) {
//to get full order details
function getOrderDetailById($id, $fields = null, $filter = array()) {
if (is_wp_error($id))
return $id;
@AndresReyesDev
AndresReyesDev / delete-all-woocommerce-products.php
Created January 11, 2018 02:00 — forked from mikaelz/delete-all-woocommerce-products.php
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@AndresReyesDev
AndresReyesDev / chromeflagstweaks.md
Created May 22, 2018 05:29 — forked from Madis0/chromeflagstweaks.md
Useful Chrome chrome://flags tweaks

Useful Chrome chrome://flags tweaks (Also for Firefox)

A list of tweaks in Chrome (Chromium) that enable hidden or upcoming features and are not editable from the main settings page.

Since I don't follow the tweaks by bugs, I am not always sure, what version of Chromium actually shows them. Therefore, I recommend using at least Beta version of the browser, if not Dev or Canary.

How to enable

  1. Open chrome://flags (browser://flags on Yandex, vivaldi://flags on Vivaldi, etc.)
  2. Search for the hashtag title
  3. Set the recommended setting
http://www.counterwise.cl/coleccion-de-web-apis-chilenas/
APIs Abiertas
Feriados: https://www.feriadosapp.com/api/
Regiones-Provincias-Comunas: https://apis.digital.gob.cl/dpa/
Farmacias de turno: http://farmanet.minsal.cl/maps/index.php/ws/getLocalesTurnos
Código postal correos de chile(devuelve pagina web): http://codigopostal.correos.cl:5004/?calle=NombreCalle%20bello&numero=6667&comuna=nombre%20Comuna
Indicadores económicos: http://iframe.lfi-app.cl/indicadores/
@AndresReyesDev
AndresReyesDev / wc-min-order-amount.php
Last active August 24, 2018 21:31 — forked from woogists/wc-min-order-amount.php
Set a minimum order amount for checkout
/**
* Set a minimum order amount for checkout
*/
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
function wc_minimum_order_amount() {
// Set this variable to specify a minimum order value
$minimum = 50;
@AndresReyesDev
AndresReyesDev / jpg-png-optimize.md
Created March 4, 2020 03:56 — forked from w33zy/jpg-png-optimize.md
Optimize your jpg & png images with jpegoptim and optipng on linux

JPG and PNG image bulk optimization

Install jpegoptim and optipng

apt update && apt install jpegoptim optipng -y

JPG optimization

cd /path/to/your/image/folder
/^((\+?56\s)?(0?2|0?3[2-5]|0?4[1-5]|0?5[123578]|0?6[13457]|0?7[1235])?(\s2\d{6}|\s\d{6}))$/
'+56 2 2xxxxxx',
'+56 51 2xxxxxx',
'+56 51 xxxxxx',
'56 75 xxxxxx',
'56 051 xxxxxx',
'56 051 2xxxxxx',
'+56 051 2xxxxxx'
@AndresReyesDev
AndresReyesDev / 1-setup.md
Created August 18, 2020 04:16 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

<IfModule mod_rewrite.c>
# Turn Off mod_dir Redirect For Existing Directories
DirectorySlash Off
# Rewrite For Public Folder
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$