Skip to content

Instantly share code, notes, and snippets.

View code-atom's full-sized avatar
🏠
Working from home

Ankit Rana code-atom

🏠
Working from home
View GitHub Profile
@code-atom
code-atom / Promise.js
Created October 25, 2016 05:48
Define the Promise
var promise = function(){
return new Promise(function(resolve, reject) {
resolve(promise2('promise 1 Complete'));
});
}
var promise2 = function(value) {
return new Promise(function(resolve, reject) {
resolve(promise3('promise 2 Complete'));
});
@code-atom
code-atom / ScrollHandler.js
Created October 24, 2016 13:06
Best Practice of use Scroll event in application
var timer = null;
var scrollEvent = function () {
if(timer!=null)
clearTimeout(timer);
timer = setTimeout(function(){
console.log('hello');
}, 100);
}
@code-atom
code-atom / CancallationTokenExample.cs
Created October 17, 2016 12:29
How to use Cancellation Token thread in Order to cancel its execution.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Threading
{
class Program
@code-atom
code-atom / Parser.cs
Created October 7, 2016 11:20
Cron to Quartz parser
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace WhoGroup.Schedulers
{
internal static class SchedulerHelper
{