Skip to content

Instantly share code, notes, and snippets.

View Natumsol's full-sized avatar
🎯
Focusing

青岚 Natumsol

🎯
Focusing
View GitHub Profile
@Natumsol
Natumsol / npmrc
Created November 25, 2022 15:34 — forked from niaodan2b/npmrc
registry=https://registry.npmmirror.com/
disturl=https://npmmirror.com/dist
sharp_binary_host=https://npmmirror.com/mirrors/sharp
sharp_libvips_binary_host=https://npmmirror.com/mirrors/sharp-libvips
profiler_binary_host_mirror=https://npmmirror.com/mirrors/node-inspector/
fse_binary_host_mirror=https://npmmirror.com/mirrors/fsevents
node_sqlite3_binary_host_mirror=https://npmmirror.com/mirrors
sqlite3_binary_host_mirror=https://npmmirror.com/mirrors
sqlite3_binary_site=https://npmmirror.com/mirrors/sqlite3
electron_mirror=https://npmmirror.com/mirrors/electron/
function shallowEqual(objA, objB) {
if (objA === objB) {
return true;
}
if (
!(typeof objA === 'object' && objA != null) ||
!(typeof objB === 'object' && objB != null)
) {
return false;
@Natumsol
Natumsol / MySQL_5-7_macOS.md
Created December 23, 2020 03:36 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@Natumsol
Natumsol / postgres-brew.md
Created December 23, 2020 03:35 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@Natumsol
Natumsol / index.html
Last active August 18, 2020 06:24
React 项目Webpack配置文件
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>App</title>
<link rel="stylesheet" href="//alifd.alicdn.com/npm/@alife/theme-243/0.1.2/next.min.css">
<link rel="stylesheet" href="/<%=htmlWebpackPlugin.options.pageName%>.css">
@Natumsol
Natumsol / git.sh
Created August 13, 2020 11:43
配置git 大小写敏感
```sh
git config --global core.ignorecase false
```
@Natumsol
Natumsol / timeoutPromise.js
Created May 7, 2020 15:13
timeoutPromise
function timeoutPromise(Pro, timeout) {
return new Promise((resolve, reject) => {
const start = Date.now();
let timeId = setInterval(() => {
const now = Date.now();
if (now - start >= timeout) {
clearInterval(timeId);
reject('timeout');
}
}, 16);
@Natumsol
Natumsol / disable_chrome_security.sh
Created December 10, 2019 07:07
禁用Chrome安全策略,允许跨域、Mix-Content
mkdir -p ~/chrome/chrome_dev_sess
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --disable-web-security --allow-running-insecure-content --user-data-dir="~/chrome/chrome_dev_sess"
@Natumsol
Natumsol / pretrained_word2vec_lstm_gen.py
Created October 25, 2019 09:28 — forked from maxim5/pretrained_word2vec_lstm_gen.py
Text generator based on LSTM model with pre-trained Word2Vec embeddings in Keras
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'maxim'
import numpy as np
import gensim
import string
@Natumsol
Natumsol / git_statistics.shell
Created September 25, 2019 07:01
Git 代码统计脚本
# 查看git上的个人代码量:
git log --author="username" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
# 统计每个人增删行数
git log --format='%aN' | sort -u | while read name; do echo -en "$name\t"; git log --author="$name" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -; done
# 查看仓库提交者排名前 5
git log --pretty='%aN' | sort | uniq -c | sort -k1 -n -r | head -n 5
#贡献值统计