Skip to content

Instantly share code, notes, and snippets.

Avatar

Juan José Ruiz de Castilla tkMageztik

View GitHub Profile
@tkMageztik
tkMageztik / make_directories_in_build_events
Created Oct 25, 2020
Create directorys using prebuild, postbuild config
View make_directories_in_build_events
https://stackoverflow.com/questions/33067769/how-to-add-a-pre-build-step-to-project-via-the-visual-studio-ide
Some code example:
if not exist DirToCreate mkdir DirToCreate
mkdir $(TargetDir)\Design
//$(TargetDir) put all the path of your bin folder of your project, so is unnecesary if you just want to create in bing folder.
@tkMageztik
tkMageztik / gist:3ba8823117d4b4f4088c2f921e6f4fff
Created Oct 23, 2020
Build specific config file by enviroment; debug, release (transform config file)
View gist:3ba8823117d4b4f4088c2f921e6f4fff
https://stackoverflow.com/a/11291067/3957327
@tkMageztik
tkMageztik / gist:dfb487aa7c4aff7044a2f6ef9baa1398
Created Sep 28, 2020
Awesome link about static code analysis by types for c# / Visual studio
View gist:dfb487aa7c4aff7044a2f6ef9baa1398
https://stackoverflow.com/questions/38635/what-static-analysis-tools-are-available-for-c
@tkMageztik
tkMageztik / git_escape_character.txt
Created Aug 27, 2019
Caracteres de Escape para password de configuración proxy en GIT (Windows)
View git_escape_character.txt
! # $ & ' ( ) * + , / : ; = ? @ [ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D
https://stackoverflow.com/questions/6172719/escape-character-in-git-proxy-password
@tkMageztik
tkMageztik / licenses.txt
Created May 21, 2018
Página que explica una posiblemente varios tipos de licencias de software
View licenses.txt
https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)
@tkMageztik
tkMageztik / dynamic_accounting.sql
Last active May 5, 2017
Conta dinámica, super útil
View dynamic_accounting.sql
DECLARE @STRSQL NVARCHAR(MAX)
SET @STRSQL =
(
SELECT
CONVERT(NVARCHAR(MAX),
(SELECT
'SELECT IdTranFin,FecTran,'
+ B.M03_TIPO_MOVIMIENTO + ' AS ''TIPO_MOVIMIENTO'','
+ B.M03_BANCO + ' AS ''BANCO'','
+ B.M03_OFICINA + ' AS ''OFICINA'','
@tkMageztik
tkMageztik / database_rename.sql
Created May 4, 2017
Renombrar base de datos, incluye restricción de base de datos, más potente que hacerlo por GUI
View database_rename.sql
USE MASTER
ALTER DATABASE NOMBRE_ANTIGUO
SET RESTRICTED_USER WITH ROLLBACK IMMEDIATE
GO
sp_rename 'NOMBRE_ANTIGUO', 'NUEVO_NOMBRE' ,'DATABASE';
GO
ALTER DATABASE NUEVO_NOMBRE
SET MULTI_USER
GO
@tkMageztik
tkMageztik / get_encoding_by_file.cs
Last active May 3, 2017
Determinar el encoding de un documento, lectura de bytes.
View get_encoding_by_file.cs
/// <summary>
/// Determina el encoding de un archivo de texto analizando su bytes order mark (BOM).
/// Usa el encoding por defecto del SO cuando la detección del endianes archivo de texto falla.
/// </summary>
/// <param name="filename">La ruta del archivo a analizar.</param>
/// <returns>El encoding detectado.</returns>
public static Encoding GetEncoding(string filename)
{
// Leyendo el BOM
var bom = new byte[4];
@tkMageztik
tkMageztik / validate_credit_card.js
Created Dec 28, 2016 — forked from DiegoSalazar/validate_credit_card.js
Luhn algorithm in Javascript. Check valid credit card numbers
View validate_credit_card.js
// takes the form field value and returns true on valid number
function valid_credit_card(value) {
// accept only digits, dashes or spaces
if (/[^0-9-\s]+/.test(value)) return false;
// The Luhn Algorithm. It's so pretty.
var nCheck = 0, nDigit = 0, bEven = false;
value = value.replace(/\D/g, "");
for (var n = value.length - 1; n >= 0; n--) {
@tkMageztik
tkMageztik / get_strange_characters_mssql
Created Oct 20, 2016
buscar caracteres extraños incluido caracter nchar(65533) collate latin1_general_BIN2.
View get_strange_characters_mssql
INSERT INTO TMP_CLIENTES
SELECT '',RTRIM(TipDoc),RTRIM(NroDoc),'',RTRIM(NomPrim),RTRIM(NomSeg),RTRIM(ApePri),RTRIM(ApeSeg),'' FROM CLIENTES
WHERE (replace(APEPRI,' ','') like '%[^.ABCDEFGHIJKLMNOPQRSTUVWXYZÑÁÉÍÓÚÜÖ''\-]%'
OR replace(APESEG,' ','') like '%[^.ABCDEFGHIJKLMNOPQRSTUVWXYZÑÁÉÍÓÚÜÖ''\-]%'
OR replace(NOMPRIM,' ','') like '%[^.ABCDEFGHIJKLMNOPQRSTUVWXYZÑÁÉÍÓÚÜÖ''\-]%'
OR replace(NOMSEG,' ','') like '%[^.ABCDEFGHIJKLMNOPQRSTUVWXYZÑÁÉÍÓÚÜÖ''\-]%')
OR CharIndex(nchar(65533) COLLATE Latin1_General_BIN2, APEPRI) > 0
OR CharIndex(nchar(65533) COLLATE Latin1_General_BIN2, APESEG) > 0
OR CharIndex(nchar(65533) COLLATE Latin1_General_BIN2, NOMPRIM) > 0
OR CharIndex(nchar(65533) COLLATE Latin1_General_BIN2, NOMSEG) > 0
You can’t perform that action at this time.