Skip to content

Instantly share code, notes, and snippets.

View jasp402's full-sized avatar

jasp402 jasp402

View GitHub Profile
this.setState({
BreadCrumb: [...this.state.BreadCrumb, { text: 'Root', key: '99', href: item.props.ariaLabel.toLowerCase() }]
})
@jasp402
jasp402 / ScrapingTable2()
Last active March 19, 2019 20:47
JavaScript - Get content Table and merge with head
let headTable = c.TABLE_HEAD;
let table = $$(c.TABLE)
.map(tr=>tr.getHTML().match(c.REGEX_TD)
.map(x=>x.indexOf('View EOB')===-1
? x.replace(c.REGEX_TAGS,'')
: x.match(c.REGEX_ONCLICK)
.map(x=>x.replace(/onclick=|"/ig,''))[0]));
let result = table.map((el, idx)=> {
let obj = {id: idx+1}; headTable.map((h,i)=>obj[headTable[i]] = el[i]);
@jasp402
jasp402 / ScrapingTableToObject()
Created March 14, 2019 20:04
JavaScript - Get text of table to convert in Object
var tblhdr = $('#folder_list_218 th').map(function () {
return $(this).text();
}).get();
console.log(tblhdr);
var tbl = $('#folder_list_218 tbody tr').map(function(idx, el) {
var td = $(el).find('td');
var obj = {id: idx+1};
@jasp402
jasp402 / ScrapingTable()
Last active March 14, 2019 14:55
JavaScript - Get Content Table
$('#ClaimPaymentGrid table tbody tr')
.get()
.map(tr=>tr
.innerHTML
.match(/<.[^>].*?<\/td>/g)
.map(x=>x.indexOf('View EOB')==-1
? x.replace(/<(.|\n)*?>/g,'')
: x.match(/(onclick=\").*?\"/g)
.map(x=>x.replace(/onclick=|"/ig,''))));
@jasp402
jasp402 / csvToJson()
Created February 5, 2019 14:37
Convert CSV to JSON with JavaScript and NodeJs
//Read file CSV
let csvfile = fs.readFileSync(__dirname + '/data/inputFile/example.csv', 'utf8');
//Function Convert CSV to JSON
const csvToJson = csv => {
const [firstLine, ...lines] = csv.split('\r\n');
return lines.map(line => firstLine.split(',').reduce((curr, next, index) => ({
...curr,
[next]: line.split(',')[index],
}), {}));
@jasp402
jasp402 / MovieFile()
Last active March 5, 2019 19:30
AutoIt: Move files source and destination with complete path
#include <File.au3>
#include <Array.au3>
#include <WinAPIFiles.au3>
#include <FileConstants.au3>
HotKeySet("{ESC}", "Terminate")
;~ ---------------------------------
Global $listFile = "Y:\FileNameTif.txt" ;TIFF y TIFF
Global $orig = "Y:\TIF\" ; SOLO TIF
@jasp402
jasp402 / SearchCopy()
Last active March 5, 2019 19:29
AutoIt: Search recursively for files and copy
#include <Array.au3>
#include <File.au3>
#include <MsgBoxConstants.au3>
Global $data = 'ZZZZZ00B40.PDF|ZZZZZ00B46.PDF|ZZZZZ00BE5.PDF|ZZZZZ00BEA.PDF|ZZZZZ00BGE.PDF|ZZZZZ00BQO.PDF|ZZZZZ00C5C.PDF|ZZZZZ00HIG.PDF|ZZZZZ00S47.PDF|ZZZZZ00S48.PDF|ZZZZZ00STJ.PDF|ZZZZZ00T4V.PDF|ZZZZZ00VGT.PDF|ZZZZZ00VGU.PDF|ZZZZZ00X8F.PDF|ZZZZZ00KB2.PDF|ZZZZZ00KDM.PDF|ZZZZZ00MLV.PDF|ZZZZZ00U1W.PDF|ZZZZZ00UEF.PDF|ZZZZZ00VDC.PDF|ZZZZZ00VDV.PDF|ZZZZZ00NYT.PDF|ZZZZZ00PS1.PDF|ZZZZZ00R6W.PDF|ZZZZZ00NZ7.PDF|ZZZZZ00NZ8.PDF|ZZZZZ00NZ9.PDF|ZZZZZ00O5T.PDF|ZZZZZ00QZS.PDF|ZZZZZ00QZT.PDF|ZZZZZ00T0X.PDF|ZZZZZ00TNG.PDF|ZZZZZ00TTF.PDF|ZZZZZ00TZV.PDF|ZZZZZ00VYP.PDF|ZZZZZ00WOH.PDF|ZZZZZ00X9Q.PDF|ZZZZZ00X9R.PDF|ZZZZZ010N0.PDF|ZZZZZ01710.PDF|ZZZZZ01711.PDF|ZZZZZ01766.PDF|ZZZZZ0179G.PDF|ZZZZZ01783.PDF|ZZZZZ017HY.PDF|ZZZZZ01AUN.PDF|ZZZZZ017JB.PDF|ZZZZZ0181X.PDF|ZZZZZ0190A.PDF|ZZZZZ019XX.PDF|ZZZZZ01B1V.PDF|ZZZZZ01CM7.PDF|ZZZZZ01EYG.PDF|ZZZZZ01EYH.PDF|ZZZZZ01HRI.PDF|ZZZZZ01F0V.PDF|ZZZZZ01F0W.PDF|ZZZZZ01F9T.PDF|ZZZZZ01FFD.PDF|ZZZZZ01FZ0.PDF|ZZZZZ01HS7.PDF|ZZZZ
@jasp402
jasp402 / CRUD - List Name function
Last active November 26, 2018 03:07
Lista de nombre de funciones
public $_database;
__construct()
get($primary_value)
get_by()
get_many($values)
get_many_by()
get_all()
insert($data, $skip_validation = FALSE)
insert_many($data, $skip_validation = FALSE)
update($primary_value, $data, $skip_validation = FALSE)
@jasp402
jasp402 / JavaScript - pilot string
Created August 14, 2018 12:50
Extraer texto que esta asi "(text) (otherText)"
let visitType = row[8].split(/[(!.*^)]/g).filter(x=>{if(x && x.trim() != '')return x});
let visitTypeResult = visitType[1];
if(visitType[0] == 'TMIBI'){
visitTypeResult = visitType[0];
}
console.log('visitType: '+visitType);
let type = $$('#FILTER_APPT_TYPE option')
.map((x,i)=>{
if((x.getText().search(visitType[0])) == 0){
function decryptCredentials(str) {
//1.- la cadena originalmente codificada
console.log('1.-',str);
//2.- uso de atob[] que es inverso de btoa[]
console.log('2.-',atob(str));
//3.- Se crea un Array con todos los valores
console.log('3.-',atob(str).split(''));
//4.- Se hace uso de map[] para procesar cada valor de array idividualmente
console.log('4.-',atob(str).split('').map(c=>c));
//5.- Se Completa cada valor del array con %00