This file contains hidden or 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
{ | |
"env": { | |
//enable nodejs environment | |
"node": true, | |
//enable browser environment | |
"browser": true | |
}, | |
"globals": { | |
"Promise" : true | |
}, |
This file contains hidden or 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
function deepFind (path, obj) { | |
var | |
paths = path.split('.'), | |
current = obj || this; | |
for (var i = 0; i < paths.length; ++i) { | |
if (current[paths[i]] == undefined) { | |
return undefined; | |
} else { | |
current = current[paths[i]]; |
This file contains hidden or 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
function setDeepValue (path, value, separator = '.', target) { | |
path = path.split(separator); | |
var obj = null; | |
var res = Object.assign({}, (target ? target : this)); | |
var current = res; | |
for (var i = 0; i < path.length; i++) { |
This file contains hidden or 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
function sequenceByArgs (runner, thingsToRun = [], fnName, values = [], method = 'apply') { | |
return new Promise((resolve, reject) => { | |
if (thingsToRun.length !== 0) { | |
var thing = (method === 'apply' && !Array.isArray(thingsToRun[0])) ? new Array(thingsToRun[0]) : thingsToRun[0]; | |
runner[fnName][method](runner, thing) | |
.then(data => { | |
values.push(data); |
This file contains hidden or 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
function promiseSequence (array, values = [], fnName, args = []) { | |
return new Promise((resolve, reject) => { | |
if (array.length !== 0) { | |
array[0][fnName].apply(array[0], args) | |
.then(data => { | |
values.push(data); | |
array.splice(0, 1); | |
promiseSequence(array, values, fnName, args) | |
.then(() => { |
This file contains hidden or 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
//#Version 4354 (22/06/2015 18:28) supervisor@GABRIEL-ACER --- Anterior 3917 (11/04/2014 01:07) | |
//#Include Configuracion | |
// | |
DECLARE @Bulto INT | |
DECLARE @AutoInc INT | |
DECLARE @PRDLink INT | |
DECLARE @PRVLink INT | |
DECLARE @RubLink INT | |
DECLARE @SRuLink INT | |
DECLARE @PRDConcepto VARCHAR(30) |
This file contains hidden or 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
SELECT t.name AS TableName, | |
SCHEMA_NAME(t.schema_id) AS SchemaName, | |
c.name AS ColumnName, | |
tp.name as DataType | |
FROM sys.tables AS t | |
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID | |
INNER JOIN sys.types tp ON c.system_type_id = tp.system_type_id | |
WHERE | |
tp.name <> 'sysname' | |
ORDER BY TableName; |
This file contains hidden or 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
SELECT * | |
FROM Table | |
WHERE Table.Field IN ( | |
SELECT Table.Field | |
FROM Table | |
GROUP BY Table.Field | |
HAVING COUNT(*) > 1 | |
) | |
ORDER BY Table.Field |
This file contains hidden or 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
public static function ansiEncode($array = array(), $fields = array()) { | |
if(!empty($array)) { | |
for($i = 0; $i < count($array); $i++) { | |
foreach($fields as $key => $value) { | |
try { |
NewerOlder