Skip to content

Instantly share code, notes, and snippets.

View yhau1989's full-sized avatar
🔥
Full Stack Developer

Samuel Pilay Muñoz yhau1989

🔥
Full Stack Developer
View GitHub Profile
@yhau1989
yhau1989 / AddressMailIsValid.cs
Created November 22, 2018 18:44
validate email address c#
private bool AddressMailIsValid(string emailaddress)
{
try
{
MailAddress m = new MailAddress(emailaddress);
return true;
}
catch (FormatException)
{
return false;
declare @cod as INT
DECLARE @grupoArticulo AS NVARCHAR(MAX)
DECLARE @totalPack AS INT
DECLARE @SumUnidadesPak INT
DECLARE @SumtotalUnidades INT
declare CURSORITO cursor FOR (select id_orden_pedido_detalle,GRUPO_ARTICULO, totalPack FROM #temp_table_name)
open CURSORITO
fetch next from CURSORITO into @cod, @grupoArticulo, @totalPack
@yhau1989
yhau1989 / index.html
Created January 3, 2020 23:27
home demo DevMania.shop
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Tailwind Starter Template - Nordic Shop: Tailwind Toolbox</title>
<meta name="description" content="Free open source Tailwind CSS Store template">
<meta name="keywords" content="tailwind,tailwindcss,tailwind css,css,starter template,free template,store template, shop layout, minimal, monochrome, minimalistic, theme, nordic">
@yhau1989
yhau1989 / GetCurrentUserC#
Created January 13, 2020 22:25
Get Current User .NET C#
protected string detecUser()
{
return (HttpContext.Current.User.Identity.Name.Length > 0) ? HttpContext.Current.User.Identity.Name : System.Security.Principal.WindowsIdentity.GetCurrent().Name;
}
@yhau1989
yhau1989 / SQL-To-DataTable.cs
Created February 18, 2020 22:36 — forked from hanssens/SQL-To-DataTable.cs
[C#] SQL Query to Databable to CSV
// Simple example for
// 1.) Read a sql server query to datatable;
// 2.) Export it to .csv
class Program
{
static void Main(string[] args)
{
var connectionString = @"data source=bla bla bla";
var selectQuery = "select * from my-table;";
@yhau1989
yhau1989 / idUnic.js
Last active April 22, 2020 09:17
Generar id único en JavaScript
const idUnic = () => {
let d = new Date();
return `${d.getDate()}${d.getMonth()}${d.getFullYear()}${d.getHours()}${d.getMinutes()}${d.getSeconds()}${d.getMilliseconds()}`;
}
@yhau1989
yhau1989 / index.html
Created August 20, 2022 01:36
Instagram SVG gradient
<svg
class="h-20 w-20"
viewBox="0 0 24 24"
>
<defs>
<linearGradient id="bones-gradient" x1="73%" y1="20%" x2="2%" y2="100%">
<stop offset="0%" stop-color="#405DE6" />
<stop offset="10%" stop-color="#5851DB" />
<stop offset="20%" stop-color="#833AB4" />
<stop offset="30%" stop-color="#C13584" />
@yhau1989
yhau1989 / mod11.js
Last active November 17, 2022 15:22
Mod 11 Javsscript
//https://es.wikipedia.org/wiki/C%C3%B3digo_de_control
const mod11 = (text: string) => {
const items = text.split("").reverse()
let weigHing = 2
let acum = 0
items.forEach((item: string): void => {
acum += Number.parseInt(item) * weigHing
weigHing = weigHing == 7 ? 2 : weigHing + 1
})
const mod = acum % 11
@yhau1989
yhau1989 / formatRutChile.js
Created November 17, 2022 15:25
Text format Rut Chile 🇨🇱
// https://www.bci.cl/corporativo/banco-en-linea/personas
// https://www.nombrerutyfirma.com/nombre
const formatRut = (text: string) => {
let f = text.split("").reverse()
const fr1 = f.splice(0, 1).join("")
const fr2 = f.splice(0, 3).join("")
const fr3 = f.splice(0, 3).join("")
const fr4 = f.splice(0, 3).join("")
const te = (_text: string, caracter = ".") =>
@yhau1989
yhau1989 / replace_regex_javascript.js
Last active November 17, 2022 15:31
Replace regex javascript
let text = 'asda12232353k';
const d = text.replace(/[^0-9, 'K']/g, "");
console.log(d)