Skip to content

Instantly share code, notes, and snippets.

View mehunk's full-sized avatar
🎯
Focusing

mehunk mehunk

🎯
Focusing
View GitHub Profile
@mehunk
mehunk / camelSnake.js
Created August 20, 2018 01:50 — forked from simongong/camelSnake.js
JavaScript: convert format of object keys between camel-case and snake-case
/**
* @param {Object|String} data string or keys of object are named in form of snake
* @param {number} depth to which level of keys should it process
* @return {Object|String} string or keys of object are named in form of camel case
*/
exports.snakeToCamel = function(data, depth) {
if (Util.isObject(data)) {
if (typeof depth === 'undefined') {
depth = 1;
}
@mehunk
mehunk / remove-node-modules.sh
Created June 4, 2019 16:33
遍历当前目录和子目录删除所有本地下载的 node_modules 依赖目录以节省磁盘空间。
#! /bin/bash
# 迭代遍历所有的文件夹,清理下载的 node_modules 文件夹
function read_dir(){
if [ -d $1"/node_modules" ]
then
rm -rf $1"/node_modules"
echo "删除依赖成功!"
fi
for file in `ls $1` # 注意此处这是两个反引号,表示运行系统命令
@mehunk
mehunk / Git 工作流分享.md
Created October 13, 2019 14:21
对 Git 和其工作流的简要介绍

Git 工作流分享

前言

背景

  • Git 产生的背景
  • 我公司为什么要使用 Git
  • 为什么时候当前的工作流
@mehunk
mehunk / circular-progress.html
Created October 25, 2020 12:53
使用 SVG 绘制的圆圈的进度图标
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
.circular-progress {
display: inline-block;
}
@mehunk
mehunk / redirect-to-google-map-japan.js
Created April 14, 2024 02:13
Tampermonkey Script - Redirect to Google Map Japan
// ==UserScript==
// @name Redirect to Google Map Japan
// @namespace http://tampermonkey.net/
// @version 2024-04-14
// @description redirect to Google Map Japan whatever the language is set
// @author mehunk
// @match https://www.google.com/maps/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=google.com
// @grant none
// ==/UserScript==