Skip to content

Instantly share code, notes, and snippets.

View leoalipazaga's full-sized avatar
🎯
Focusing

Leonardo Alipazaga leoalipazaga

🎯
Focusing
  • Lima, Peru
View GitHub Profile
@leoalipazaga
leoalipazaga / index.html
Created September 29, 2019 20:18
JS Bin FrontendMasters Search input using rxjs // source https://jsbin.com/zibiwoq
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="FrontendMasters Search input using rxjs">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>-
</head>
<body>
<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
@leoalipazaga
leoalipazaga / validation date angular
Created December 20, 2018 01:49
Validation date angular
private _ValidateDate(groupControl: FormGroup): boolean {
// const value = groupControl.value;
// const parms = str.split(/[\.\-\/]/);
const month = groupControl.get('mes').value; // parse date into variables
const day = groupControl.get('dia').value;
const year = groupControl.get('anio').value;
if ((month === 4 || month === 6 || month === 9 || month === 11) && day === 31) {
console.info('no valid');
return false;
}
@leoalipazaga
leoalipazaga / javascript-promise-timeout.js
Created November 27, 2018 00:53 — forked from john-doherty/javascript-promise-timeout.js
Adds a timeout to a JavaScript promise, rejects if not resolved within timeout period
/**
* wraps a promise in a timeout, allowing the promise to reject if not resolve with a specific period of time
* @param {integer} ms - milliseconds to wait before rejecting promise if not resolved
* @param {Promise} promise to monitor
* @Example
* promiseTimeout(1000, fetch('https://courseof.life/johndoherty.json'))
* .then(function(cvData){
* alert(cvData);
* })
* .catch(function(){
@leoalipazaga
leoalipazaga / execution-context.js
Last active February 21, 2018 06:52
Execution Context Stack
function a() {
console.log('Function A')
b();
}
function b () {
console.log('Function B');
c();
}
function c() {
console.log('Function C');
@leoalipazaga
leoalipazaga / index.html
Created January 5, 2018 13:17
HTML: Código Básico
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>