Skip to content

Instantly share code, notes, and snippets.

View liuliangsir's full-sized avatar
💻
Coding

流浪大法师 liuliangsir

💻
Coding
View GitHub Profile
@liuliangsir
liuliangsir / cloudSettings
Last active November 26, 2019 07:42 — forked from okunishinishi/Remove all git tags
Delete all git remote tags
{"lastUpload":"2019-11-26T07:42:01.191Z","extensionVersion":"v3.4.3"}
@liuliangsir
liuliangsir / tmux-cheatsheet.markdown
Created December 25, 2019 02:22 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@liuliangsir
liuliangsir / tmux.md
Created December 25, 2019 02:23 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@liuliangsir
liuliangsir / git-recover-branch.md
Created January 10, 2020 03:34 — forked from jbgo/git-recover-branch.md
How to recover a git branch you accidentally deleted

UPDATE: A better way! (August 2015)

As pointed out by @johntyree in the comments, using git reflog is easier and more reliable. Thanks for the suggestion!

 $ git reflog
1ed7510 HEAD@{1}: checkout: moving from develop to 1ed7510
3970d09 HEAD@{2}: checkout: moving from b-fix-build to develop
1ed7510 HEAD@{3}: commit: got everything working the way I want
70b3696 HEAD@{4}: commit: upgrade rails, do some refactoring
@liuliangsir
liuliangsir / .gitlab-ci.yml
Created April 13, 2020 06:01 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@liuliangsir
liuliangsir / eslint-config.json
Created April 23, 2020 07:51
A configuration file for ESLint
{
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {}
},
"env": {
"es6": true,
"es2017": true,
"browser": true
},

Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL)

Windows just released the windows subsystem for linux feature to the public with its latest windows fall creator update, if you are not familiar with this feature it allows you to run linux binaries natively on windows - F.A.Q.

Enabling WSL

The feature is not enabled by default and you need to activate it, you can do it via powershell (with admin rights):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
@liuliangsir
liuliangsir / web-servers.md
Created February 1, 2021 01:58 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
/*
* The default style sheet used to render HTML.
*
* Copyright (C) 2000 Lars Knoll (knoll@kde.org)
* Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
POST /jiulku/api/index.php/order/add_vote_item_poll HTTP/1.1
Host: api.173zb.com
Connection: keep-alive
Content-Length: 287
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36 MicroMessenger/7.0.9.501 NetType/WIFI MiniProgramEnv/Windows WindowsWechat
WX-APP-ID: com.jiulku.yizhimao.tppx
content-type: application/x-www-form-urlencoded
Referer: https://servicewechat.com/wx66d2d0c3032fff93/68/page-frame.html
Accept-Encoding: gzip, deflate, br
Pragma: no-cache