Skip to content

Instantly share code, notes, and snippets.

@miguelcperez
miguelcperez / web.config
Created July 23, 2021 17:23
fix openui5 i18n error in C#
// If your application doesn't recognize i18n, use this tip
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".properties" mimeType="application/text"/>
</staticContent>
</system.webServer>
</configuration>
@miguelcperez
miguelcperez / txt
Created April 19, 2019 05:00
send multidependence values sapui5
/*flavor.Bottler.ExchangeRateCountrySaleNWSP = sap.ui.getCore().byId('input_CTCS1' + country.CountryCode + '_' + flavor.FlavorCode + '_calc').getValue();
flavor.Bottler.PTCUnitLocal = sap.ui.getCore().byId('input_UPTC' + country.CountryCode + '_' + flavor.FlavorCode).getValue();
flavor.Bottler.PTCUnitUSD = sap.ui.getCore().byId('input_UPTC' + country.CountryCode + '_' + flavor.FlavorCode + '_calc').getValue();
flavor.Bottler.PTRBoxLocal = sap.ui.getCore().byId('input_BPTR' + country.CountryCode + '_' + flavor.FlavorCode).getValue();
flavor.Bottler.PTRBoxUSD = sap.ui.getCore().byId('input_BPTR' + country.CountryCode + '_' + flavor.FlavorCode + '_calc').getValue();
flavor.Bottler.NWSPLocal = sap.ui.getCore().byId('input_BNWSP' + country.CountryCode + '_' + flavor.FlavorCode).getValue();
flavor.Bottler.NWSPUSD = sap.ui.getCore().byId('input_BNWSP' + country.CountryCode + '_' + flavor.FlavorCode + '_calc').getValue();
flavor.Bottler.ExchangeRateCountryProduction = sap.ui.g
@miguelcperez
miguelcperez / txt
Created April 19, 2019 02:36
double tab container logic
// Create FlavorTab by flavor and country (Bottler)
newFlavorTab = new sap.m.TabContainerItem('flavorTab_' + countryItemKey + '_' + flavor.FlavorCode, {
name: flavor.FlavorDescription,
modified: false,
content: [
new sap.m.Table('flavorTable_'+ countryItemKey + '_' + flavor.FlavorCode ,{
columns: [
new sap.m.Column({
header: new sap.m.Label({
@miguelcperez
miguelcperez / post_tag.sql
Last active March 19, 2018 20:47
Query Posts relacionados por TAG
SELECT c.post_id, c.post_c FROM (
SELECT b.post_id, COUNT(b.post_id) AS post_c FROM(
SELECT post_id, tag_id FROM post_tag
WHERE tag_id IN (SELECT tag_id FROM post_tag WHERE post_id = 1)) AS b
GROUP BY b.post_id
) AS c
WHERE c.post_c >= 2
@miguelcperez
miguelcperez / EnviarCorreo.cs
Last active February 14, 2024 13:26
Envío de correo electrónico ejecutado en segundo plano - C# .Net
using (StreamReader reader = new StreamReader(Server.MapPath("~/Views/Shared/Correo.html")))
{
body = reader.ReadToEnd();
}
body = body.Replace("{usuario}", usuario); // reemplazar valores en el correo (Correo.html)
var message = new MailMessage();
message.To.Add(new MailAddress("contacto@mail.com"));// correo destino // message.To -> destinatarios visibles entre ellos | message.Bcc -> destinatarios no visibles entre ellos
message.From = new MailAddress("admin@mail.com", "Administrador de Sistemas"); // Remitente del mensaje
@miguelcperez
miguelcperez / AgeCalculator.txt
Last active July 3, 2017 04:25
Oracle Age Calculator Function
TRUNC((trunc(sysdate-fechanacimiento) )/365.25),0)
trunc(trunc(trunc(sysdate-fechanacimiento) - (365.25 * TRUNC(trunc(sysdate-fechanacimiento) )/365.25,0)))/ 30.4375)
<VirtualHost *:80>
ServerName blog.app
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/blog/public
<Directory /var/www/html/blog/public>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
@miguelcperez
miguelcperez / animateSVG.html
Created March 3, 2017 21:49
SVG Animation Elements
<!--/********** Animation Element **********/-->
<!-- 1. animate -->
<svg width="120" height="120" viewPort="0 0 120 120" version="1.1">
<rect x="10" y="10" width="100" height="100">
<animate attributeType="XML" attributeName="x" from="-100" to="120" dur="10s" repeatCount="indefinite"/>
</rect>
</svg>
<!--
Check the file/directory permissions
$ tail -f /var/log/apache2/access.log /var/log/apache2/error.log
* sudo apt-get remove package_name
* sudo apt-get purge package_name
* sudo apt-get clean package_name