Skip to content

Instantly share code, notes, and snippets.

@Sharp6
Sharp6 / komodal.js
Created March 20, 2017 19:49
Binding ko observables to a bootstrap modal
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<div class="container">
@Sharp6
Sharp6 / index.js
Created March 2, 2017 19:58
Recursive async
var request = require('request');
var doCallWithRecover = function() {
return new Promise(function(resolve, reject) {
request('https://pdbss.herokuapp.com', function(err,data) {
if(checkIfOk(data)) {
resolve(data);
} else {
return doCallWithRecover();
}