Skip to content

Instantly share code, notes, and snippets.

View espinozaulises's full-sized avatar
🏠
Working from home

Ulises Vázquez Espinoza espinozaulises

🏠
Working from home
View GitHub Profile
@espinozaulises
espinozaulises / drop_all_tables.sql
Created September 6, 2023 21:46
Drops all tables and indexes from a SQL Server database
/* Drop all Primary Key constraints */
DECLARE @name VARCHAR(128)
DECLARE @constraint VARCHAR(254)
DECLARE @SQL VARCHAR(254)
SELECT @name = (SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' ORDER BY TABLE_NAME)
WHILE @name IS NOT NULL
BEGIN
SELECT @constraint = (SELECT TOP 1 CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = @name ORDER BY CONSTRAINT_NAME)
@espinozaulises
espinozaulises / ajustaMontos
Created February 19, 2020 04:19
ajustaMontos
ajustaMontos(datos: NcDevolucion, rel: NcRelDevolucion, valor: number) {
/* Calculamos el saldo por facturar de el doc relacionado actual */
let id = rel.id;
let saldoFactura = rel.montoPorPagar - valor;
rel.saldoFactura = saldoFactura;
let totalNc = datos.total - valor;
var r = datos.relacionados;
for (const prop in r) {
@espinozaulises
espinozaulises / OpenSans.css
Last active November 20, 2019 09:46
Open Sans @font-face CSS file
/*==========================================================
Open Sans
==========================================================*/
@fontPath: '../fonts'; /* LESS Syntaxis. Replace this in CSS */
@font-face {
font-family: 'OpenSansLight';
src: url('@{fontPath}/OpenSans-Light-webfont.eot');
src: url('@{fontPath}/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('@{fontPath}/OpenSans-Light-webfont.woff') format('woff'),
url('@{fontPath}/OpenSans-Light-webfont.ttf') format('truetype'),
@espinozaulises
espinozaulises / csv_to_array.php
Created September 20, 2012 15:07 — forked from jaywilliams/csv_to_array.php
Convert a comma separated file into an associated array.
<?php
/**
* Convert a comma separated file into an associated array.
* The first row should contain the array keys.
*
* Example:
*
* @param string $filename Path to the CSV file
* @param string $delimiter The separator used in the file
* @return array
@espinozaulises
espinozaulises / fonts.css
Created September 9, 2012 00:15
Style Sheet Open Sans @font-face kit
/*==========================================================
Open Sans
==========================================================*/
@font-face {
font-family: 'Open Sans';
src: url('fontPath/OpenSans-Light-webfont.eot');
src: url('fontPath/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
url('fontPath/OpenSans-Light-webfont.woff') format('woff'),
url('fontPath/OpenSans-Light-webfont.ttf') format('truetype'),
url('fontPath/OpenSans-Light-webfont.svg#OpenSansLight') format('svg');