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
// This dummy function is just to answer the following simple question: | |
// Do these new AWS Lambda Function URLs still suffer the same timeout issues that the API Gateway does? Namely 30s? | |
// Answer: According to my local testing I found they dont suffer the 30s limitation, which is pretty amazing. | |
exports.handler = async (event) => { | |
console.log(event) | |
let timeoutSeconds = +event.queryStringParameters.timeout | |
if (typeof timeoutSeconds !== 'number') { | |
timeoutSeconds = 40 |
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
# This redirects all users except me to a temporal website. | |
# Inspired from: https://stackoverflow.com/questions/293285/want-to-redirect-all-visitors-except-for-me | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
# Redirect all except allowed IP | |
# The HTTP:X-Forwarded-For is used when the site is behind a proxy or load balancer like CloudFlare, AWS Application Load Balancer, etc. | |
# The used ip should be the public ip of your router, use a website like "whats my public ip" to know this. | |
# In the case your site isn't behind proxies or load balancer, replace "HTTP:X-Forwarded-For" to "REMOTE_ADDR" |
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 hexToGlslColor(hexColor) { | |
var r = +hexColor >> 16; | |
r /= 255; | |
var g = (+hexColor & 0x00FF00) >> 8; | |
g /= 255; | |
var b = (+hexColor & 0x0000FF); | |
b /= 255; | |
return `vec4(${r.toFixed(5)}, ${g.toFixed(5)}, ${b.toFixed(5)}, 1.0)` | |
} |
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
<script | |
src="https://code.jquery.com/jquery-3.3.1.min.js" | |
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" | |
crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
// Avoids conflicts with the theme jquery version | |
// https://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page | |
var jQuery_3_3_1 = $.noConflict(true); | |
</script> |
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
// request generator | |
function create_req(method, url, bodyObj) | |
{ | |
var xmlhttp = new XMLHttpRequest(); | |
xmlhttp.open(method, url); | |
// Gets the parsed data from the request body. Only for the POST/PUT/DELETE methods. | |
xmlhttp.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); | |
xmlhttp.setRequestHeader('Content-Type', 'text/json; charset=UTF-8'); |
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
# Author: Jose Romualdo Villalobos Perez | |
# Date: 18 oct, 2018 | |
# Shell is white-space sensitive in many places, inluding = operator | |
# var = foo throw error | |
# var=foo is fine | |
dirName=$1 | |
DATE=`date '+%Y-%m-%d-%H-%M-%S'` | |
zipFile="$dirName-$DATE.zip" |
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 Financial = { | |
InteresSimple: { | |
// El nombre del metodo hace referencia a la incognita que se quiere hallar | |
Final: null, // Valor al final de la inversion | |
Presente: null, // Valor al final de la inversion | |
Interes: null // Tasa de interes requerida | |
}, | |
InteresCompuesto: { | |
// El nombre del metodo hace referencia a la incognita que se quiere hallar | |
Final: null, // Valor al final de la inversion |
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 prestacionServicios(salario) | |
{ | |
var retencion = salario*0.11; | |
var montoGrabable = salario*0.4; | |
var pension = 0.165*montoGrabable; | |
var salud = 0.12*montoGrabable; | |
return (salario - retencion - pension - salud) | |
} |
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
# SUB QUERIESS | |
```SQL | |
SELECT name, MIN(cost) FROM items WHERE name LIKE '%frog%' AND seller_id IN ( | |
SELECT DISTINCT seller_id FROM items WHERE name LIKE '%frog%' | |
); |
NewerOlder