Skip to content

Instantly share code, notes, and snippets.

@thoamsy
thoamsy / index.html
Created November 23, 2021 09:00
TikTok Test
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<meta name="google" content="notranslate" />
<meta name="format-detection" content="telephone=no" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>
@thoamsy
thoamsy / deepClone.js
Created February 27, 2019 16:12
JS 深拷贝
function deepClone(obj, hash = new WeakMap()) {
if (obj !== Object(obj) || typeof obj === 'function') return obj;
if (obj instanceof Set) return new Set(obj);
if (hash.has(obj)) return hash.get(obj);
let result;
if (obj instanceof Date) {
result = new Date(obj);
} else if (obj instanceof RegExp) {
result = new RegExp(obj.source, obj.flags);
@thoamsy
thoamsy / getBinary.c
Last active October 4, 2018 13:55
C 语言实现的将 Double 转成二进制
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
typedef struct Binary {
char sign;
char exp[12];
char precision[53];