Skip to content

Instantly share code, notes, and snippets.

View linyongping's full-sized avatar

Yongping Lin linyongping

  • Chongqing, China
View GitHub Profile
@linyongping
linyongping / git-ssh-error-fix.sh
Created October 17, 2023 06:12 — forked from Tamal/git-ssh-error-fix.sh
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone git@github.com:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@linyongping
linyongping / delete_git_submodule.md
Created October 24, 2019 15:18 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@linyongping
linyongping / poke.py
Created March 15, 2019 14:57
python识别
#coding=utf-8
#视频人脸检测类 - OpenCV版本
import cv2
from PIL import Image
import pytesseract
videoPath = 'ipcam/videos/test.mp4'
# 图片识别方法
@linyongping
linyongping / difference.js
Created January 19, 2019 06:55 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {
##
# Put this file in /etc/nginx/conf.d folder and make sure
# you have a line 'include /etc/nginx/conf.d/*.conf;'
# in your main nginx configuration file
##
##
# Redirect to the same URL with https://
##
@linyongping
linyongping / eventEmitter.js
Created April 10, 2018 15:08
eventEmitter.js
class EventEmitter {
constructor(eventMap = new Map()) {
this.eventMap = eventMap
}
addEventListener(event, handler) {
if(this.eventMap.has(event)) {
this.eventMap.set(event, this.eventMap.get(event).concat([handler]))
}else {
this.eventMap.set(event, [handler])
@linyongping
linyongping / cloudSettings
Last active August 27, 2018 06:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-08-27T06:37:07.756Z","extensionVersion":"v3.0.0"}