This file contains 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
#r "nuget:System.Reactive/5.0.0" | |
using System.Reactive.Linq; | |
public class TimeStopWhenNoOneCares | |
{ | |
private IObservable<long> _Interval; | |
private long _Time; | |
public IDisposable ObserveTime( Action<long> subscriber ) | |
{ |
This file contains 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
using System.Reactive.Linq; | |
public class MyStateType { | |
} | |
IObservable<MyStateType> observable = Observable.Create<MyStateType>( observer => { | |
// should be CancellationTokenSource | |
// but use bool so it easier to understand | |
bool stop = false; |
This file contains 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
public class TimeStopWhenNoOneCares | |
{ | |
private long _Time; | |
private CancellationTokenSource _Canceller; | |
private Action<long> _TimeHasSpassed; | |
public event Action<long> TimeHasSpassed | |
{ | |
add { | |
_TimeHasSpassed += value; |
This file contains 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
module.directive('ncbImgdefer', function ($http, $datacontext) { | |
var imgList = []; | |
var existingTimeout = null; | |
function fixIsotope() { | |
if (existingTimeout != null) { | |
window.clearTimeout(existingTimeout); | |
existingTimeout = null; |
This file contains 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 delayStack = 100; | |
window.deferCSS = function (url) { | |
var link = document.createElement('link'); | |
link.rel = 'stylesheet'; | |
link.href = url; | |
link.type = 'text/css'; |
This file contains 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 getBathText = function (inputNumber) { | |
var getText = function (input) { | |
var toNumber = input.toString(); | |
var numbers = toNumber.split('').reverse(); | |
var numberText = "/หนึ่ง/สอง/สาม/สี่/ห้า/หก/เจ็ด/แปด/เก้า/สิบ".split('/'); | |
var unitText = "/สิบ/ร้อย/พ้น/หมื่น/แสน/ล้าน".split('/'); | |
var output = ""; |