Skip to content

Instantly share code, notes, and snippets.

View liorama's full-sized avatar

Lior liorama

  • Testim.io
  • Tel Aviv
View GitHub Profile
@liorama
liorama / mock_html_offer.html
Created February 13, 2018 00:04
Mock html poll
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
.item {
display: block;
}
</style>
</head>
@liorama
liorama / cbWrapper.js
Created July 20, 2017 14:55
WrapCb will wrap all callbacks counting them and calling finalCb when all CB's were called
var cbCounter = 0
function finalCb(){
// Do something when all CBs are called
}
function wrapCb(cb, context){
cbCounter++;
return function(){ // context is optional, if you need to have the `this` changed for the CB
cb && cb.call(context || this); // so CB isn't mandatory
cbCounter--;