/**
* Generates a simple WHERE clause for TypeORM based on query and fields.
*
* @template T - The entity type.
* @param {string} query - The search query.
* @param {string} fields - A comma-separated list of fields to search in.
* @param {FindOptionsWhere<T>} [defaultWhere={}] - Default WHERE conditions.
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 Luhn = { | |
// length of our number (check digit included) | |
length: 10, | |
pow2: [0, 2, 4, 6, 8, 1, 3, 5, 7, 9], | |
// compute check digit | |
checksum: function (x) { | |
var sum = 0; | |
var n; | |
var odd = false; | |
for (var i = x.length - 1; i >= 0; --i) { |
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
export const validateCard = ((arr) => { | |
return (num) => { | |
let len = num.length; | |
let bit = 1; | |
let sum = 0; | |
let val; | |
while (len) { | |
val = parseInt(num.charAt(--len), 10); | |
// eslint-disable-next-line no-bitwise,no-cond-assign | |
sum += (bit ^= 1) ? arr[val] : val; |
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
export const getCardType = (num) => { | |
let type = 'unknow'; | |
if (num.match('^3[47]\\d{0,13}')) { | |
type = 'amex'; | |
} else if (num.match('^(?:6011|65\\d{0,2}|64[4-9]\\d?)\\d{0,12}')) { | |
type = 'discover'; | |
} else if (num.match('^3(?:0([0-5]|9)|[689]\\d?)\\d{0,11}')) { | |
type = 'diners'; | |
} else if (num.match('^(5[1-5]\\d{0,2}|22[2-9]\\d{0,1}|2[3-7]\\d{0,2})\\d{0,12}')) { | |
type = 'mastercard'; |
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
const isValidUrl = (url) => { | |
const regex = new RegExp(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)?/gi); | |
return url.match(regex); | |
}; |
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
#!/usr/bin/env node | |
const fs = require('fs'); | |
const models = require('../models'); | |
for (const model in models) { | |
const tableName = models[model].tableName; | |
let defaultValue = ''; | |
let onUpdate = ''; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#include <iostream> | |
#include <stdlib.h> | |
#include <string> | |
#ifdef WINDOWS | |
#include <windows.h> | |
#else | |
// Assume POSIX | |
#include <termios.h> | |
#include <unistd.h> | |
#endif |
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
#include <iostream> | |
#include <stdlib.h> | |
#include <cstdlib> | |
#include <string.h> | |
using namespace std; | |
// Varibles Globales | |
int error = 0, salir = 0, atras = 1; | |
string admUser="admin", admPass="54321", cajUser="cajero", cocUser="cocina", usrPass="12345"; |
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
/* ----------------------------------------------- */ | |
/* ------------------- Laptops ------------------- */ | |
/* ----------------------------------------------- */ | |
/* ----------- Laptops Non-Retina Screens ----------- */ | |
@media screen | |
and (min-device-width: 1200px) | |
and (max-device-width: 1600px) | |
and (-webkit-min-device-pixel-ratio: 1) { | |
} |
NewerOlder