Skip to content

Instantly share code, notes, and snippets.

View ishowshao's full-sized avatar

ishowshao ishowshao

  • unemployed
  • Shanghai, China
View GitHub Profile
@ishowshao
ishowshao / rename-ctime.js
Last active July 2, 2023 13:46
rename all files in the folder to the file creation time
// The frame is written by GPT, and I perfect the details
const fs = require("fs");
const path = require("path");
const dayjs = require('dayjs');
const folderPath = "path/to/folder";
fs.readdir(folderPath, (err, files) => {
if (err) {
console.error(err);
@ishowshao
ishowshao / index.md
Created April 2, 2018 12:36
iOS 11 wkwebview env(safe-area-inset-top)

iOS 11 中 wkwebview 中 使用

constant(safe-area-inset-top)
env(safe-area-inset-top) 

会导致被设置区域闪动,一种被异步/延时设置了样式的感觉

@ishowshao
ishowshao / meta2.html
Created March 15, 2018 07:09
mobile device meta device width
<meta name="viewport" content="width=device-width, initial-scale=1">
@ishowshao
ishowshao / meta.html
Created March 14, 2018 13:46
双核浏览器使用chrome内核
<meta name="renderer" content="webkit">
//360 6.X 以上可识别
<meta name="force-rendering" content="webkit">
//其他双核可识别
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
//对于没有自带 IE7 内核的浏览器 强制使用用户已安装的最高版本浏览器渲染, 有Chrome框架的优先使用
@ishowshao
ishowshao / pwdgen.html
Last active March 12, 2018 16:16
pwdgen
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>随机密码生成器</title>
<meta name="viewport" content="width=device-width">
</head>
<body>
@ishowshao
ishowshao / index.md
Last active April 13, 2023 03:39
Netatalk搭建AFP文件共享服务 for Mac

Netatalk搭建AFP文件共享服务 for Mac

Netatalk - Unix file and print services for Apple clients.

Netatalk 是一个免费开源的AppleTalk 通信协议的实现,Linux 或者BSD 系统通过它可以充当Mac 的文件服务器(AppleShare File Server, 网络协议是AFP)、AppleTalk 路由、打印服务器等。

Netatalk 网址 http://netatalk.sourceforge.net/  本文撰写时最新版本是 3.1.11

从github获取netatalk最新源代码到server上

@ishowshao
ishowshao / index.md
Last active December 4, 2017 08:45
Navigation Timing

Navigation Timing

Introduction

这份规范介绍了和WebApp的时间信息相关的一个接口,没有覆盖如何收集、存储、上报接口提供的信息。

PerformanceTiming 接口

接口定义:

@ishowshao
ishowshao / index.md
Created November 15, 2017 07:09
Building OpenCV.js from source

从源码构建opencv.js

@ishowshao
ishowshao / index.html
Created November 14, 2017 10:52
JS图像二值化
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id="canvas" onclick="showInfo()"></canvas>
<img id="img" src="1.jpg" width="300" height="200" hidden>
@ishowshao
ishowshao / ajax.js
Created June 8, 2017 09:40
ajax on fetch
/**
* @file
* @author shaoshuai
*/
export default {
queryString(data) {
let body = [];
for (let [key, value] of Object.entries(data)) {
body.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
}