These rules are adopted from the AngularJS commit conventions.
This file contains hidden or 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
const makeCRCTable = () => { | |
let c; | |
const crcTable = []; | |
for (let n = 0; n < 256; n++) { | |
c = n; | |
for (let k = 0; k < 8; k++) { | |
c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; | |
} | |
crcTable[n] = c; | |
} |
This file contains hidden or 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
// copied from https://github.com/lukeed/tinydate | |
var RGX = /([^{]*?)\w(?=\})/g; | |
var MAP = { | |
YYYY: 'getFullYear', | |
YY: 'getYear', | |
MM: function (d) { | |
return d.getMonth() + 1; | |
}, | |
DD: 'getDate', |
This file contains hidden or 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
#!/usr/bin/env ts-node | |
import path from 'path' | |
import glob from 'glob' | |
import csv from 'csv-parser' | |
// @ts-ignore | |
import { writeFile, readFile } from 'fs/promises' | |
import fs from 'fs' | |
async function main() { |
This file contains hidden or 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
{ | |
"repos": [ | |
{ "repoName": "AA", "targetBranchName": "feature/v1" }, | |
{ "repoName": "BB", "originBranchName": "master", "targetBranchName": "feature/v2" }, | |
{ "repoName": "CC", "originBranchName": "feature/v1", "alias": "folder Name of CC in your locale", "targetBranchName": "feature/xxx/sync-patch" } | |
], | |
"patch": "DD/*.patch" | |
} |
This file contains hidden or 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
#!/bin/bash | |
set -eo pipefail | |
# 缩短 url,自定义短网址 | |
api="https://git.io" | |
short_url() { | |
# 防御编程 | |
# 无参数输入 |
This file contains hidden or 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
#!/bin/bash | |
# 在转换之前先确保 png 是否为 png24 位,否则跳去 [Photopea | Online Photo Editor](https://www.photopea.com/) 先导出为png格式文件,再进行如下操作 | |
# 确保是否有安装 potrace | |
# HOMEBREW_NO_AUTO_UPDATE=1 brew install potrace | |
# 确保是否有安装 convert | |
# HOMEBREW_NO_AUTO_UPDATE=1 brew install imagemagick | |
File_png="${1?:Usage: $0 file.png}" |
This file contains hidden or 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 findItem (data, filterFn, childrenKey = 'children', targetTopLevel = 1) { | |
let resultItem | |
let resultTopLevelItem | |
let topLevelItem | |
function findNestItem (d, filter, level) { | |
if (!d || !d.length) { | |
return | |
} |
This file contains hidden or 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
let raf = null; | |
function requestAnimationFrame(callback) { | |
if (!raf) { | |
raf = ( | |
window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
function (callback) { | |
return setTimeout(callback, 16) | |
} |
These rules are adopted from the AngularJS commit conventions.
NewerOlder