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
export const getRandom32x = (x: number = 1): string => { | |
if (x > 8) x = 8; | |
const uint32Array = new Uint32Array(x); | |
crypto.getRandomValues(uint32Array); | |
return uint32Array.reduce((a: string, v: number) => { | |
return a + v.toString(16).padStart(8, '0'); | |
}, ""); | |
}; |
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
import angular = require('angular'); | |
function OnScrollToEndDirective($window, $document) { | |
'use strict'; | |
return { | |
restrict: 'A', | |
link: link, | |
}; |
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
function termRect () { | |
var tty = require('tty'); | |
var width; | |
var height; | |
if(tty.isatty(1) && tty.isatty(2)) { | |
if(process.stdout.getWindowSize) { | |
width = process.stdout.getWindowSize(1)[0]; | |
height = process.stdout.getWindowSize(1)[1]; |