Skip to content

Instantly share code, notes, and snippets.

View yanzhihong23's full-sized avatar
🏠
Working from home

Hom yanzhihong23

🏠
Working from home
View GitHub Profile
@yanzhihong23
yanzhihong23 / 0_reuse_code.js
Created January 12, 2017 10:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
function to64bitFloat(number) {
var i, result = "";
var dv = new DataView(new ArrayBuffer(8));
dv.setFloat64(0, number, false);
for (i = 0; i < 8; i++) {
var bits = dv.getUint8(i).toString(2);
if (bits.length < 8) {
bits = new Array(8 - bits.length).fill('0').join("") + bits;