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
/* Very basic EventEmitter class */ | |
class EventEmitter { | |
constructor() { | |
this.events = new Map(); | |
} | |
on(eventname, callback) { | |
if(this.events.has(eventname)) { | |
const events = this.events.get(eventname); | |
events.push(callback); | |
return this.events.set(eventname, events); |
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
private readUrl(url: string): Promise < string > { | |
return new Promise((resolve, reject) => { | |
https.get(url, (response) => { | |
response.setEncoding('utf8'); | |
let body = ''; | |
response.on('data', (data) => { | |
body += data; | |
}); | |
response.on('end', () => { | |
resolve(body); |
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
private getSuffixByFileName(fsPath: string): string | undefined { | |
const metadataFileExt = '-meta.xml'; | |
const fileName = path.basename(fsPath); | |
if (fileName.endsWith(metadataFileExt)) { | |
return fileName.substring(0, fileName.indexOf('-meta.xml')).split('.').slice(1, 2).pop(); | |
} | |
return undefined; | |
} | |
private getTypeDefinitionByFileName(fsPath: string): MetadataType | undefined { |
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
const fs = require('fs').promises; | |
const ALLOWED_MUTATIONS = [ | |
'manage_splash', | |
'create_public_api_credential', | |
'delete_public_api_credential' | |
]; | |
const loadSchema = async (file) => { | |
try { |
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
https://www.youtube.com/watch?v=PSoOFn3wQV4|The Bangles - Eternal Flame | |
https://www.youtube.com/watch?v=W6hknFigMSI|Bonnie Tyler - Total Eclipse of the Heart | |
https://www.youtube.com/watch?v=mUg5aEy-8CQ|Glenn Medeiros - Nothing's Gonna Change My Love For You | |
https://www.youtube.com/watch?v=3wxyN3z9PL4|Starship - Nothing's Gonna Stop Us Now | |
https://www.youtube.com/watch?v=K1b8AhIsSYQ|Starship - We Built This City | |
https://www.youtube.com/watch?v=ZvMsp7s78Do|Chesney Hawkes - The One and Only | |
https://www.youtube.com/watch?v=I_2D8Eo15wE|Ram Jam - Black Betty | |
https://youtu.be/djV11Xbc914|a-ha - Take On Me | |
https://www.youtube.com/watch?v=k2C5TjS2sh4|Roxette - It Must Have Been Love | |
https://www.youtube.com/watch?v=xSZBIs0gs0E|Natalie Imbruglia - Torn |
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
import * as React from 'react'; | |
import { | |
Icon, | |
MainSectionLayoutTypes, | |
MainSectionLayout, | |
Button | |
} from 'osp-ui-components'; | |
import { FormattedMessage } from 'react-intl'; |
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
Funcion suma <- totalFacturado ( facturas ) | |
suma <- 0 | |
Para i<-1 Hasta 5 Con Paso 1 Hacer | |
suma <- suma + facturas[i, 4] | |
Fin Para | |
Fin Funcion | |
Funcion suma <- totalKilos ( facturas ) | |
suma <- 0 | |
Para i<-1 Hasta 5 Con Paso 1 Hacer |
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
'hello_my_name_is_ben'.replace(/_/g, ' ').replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); | |
// Hello My Name Is Ben |
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
var options = RRule.parseString('FREQ=MONTHLY;INTERVAL=1'); | |
options.dtstart = moment.utc('2019-05-16 12:30:00').toDate(); | |
options.count = 2; | |
var rule = new RRule(options) | |
var nextRun = rule.all().slice(-1).pop(); | |
console.log(moment(nextRun).format('YYYY-MM-DD H:mm:ss')); |
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
"animal_brand_name".replace(/_/g, ' ').replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); }); |