Skip to content

Instantly share code, notes, and snippets.

jasp402 jasp402

Block or report user

Report or block jasp402

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View paseDate()
function pad (n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
function toFormattedDateString(timestamp, includeTime){
if(typeof includeTime == 'undefined'){
includeTime = true;
}
View SetStatus React Push
this.setState({
BreadCrumb: [...this.state.BreadCrumb, { text: 'Root', key: '99', href: item.props.ariaLabel.toLowerCase() }]
})
@jasp402
jasp402 / ScrapingTable2()
Last active Mar 19, 2019
JavaScript - Get content Table and merge with head
View ScrapingTable2()
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 Mar 14, 2019
JavaScript - Get text of table to convert in Object
View ScrapingTableToObject()
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 Mar 14, 2019
JavaScript - Get Content Table
View ScrapingTable()
$('#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 Feb 5, 2019
Convert CSV to JSON with JavaScript and NodeJs
View csvToJson()
//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 Mar 5, 2019
AutoIt: Move files source and destination with complete path
View MovieFile()
#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 Mar 5, 2019
AutoIt: Search recursively for files and copy
View SearchCopy()
#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 Nov 26, 2018
Lista de nombre de funciones
View CRUD - List Name function
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 Aug 14, 2018
Extraer texto que esta asi "(text) (otherText)"
View JavaScript - pilot string
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){
You can’t perform that action at this time.