Skip to content

Instantly share code, notes, and snippets.

View yanqiw's full-sized avatar

Frank(Wang.Yan.Qi) yanqiw

View GitHub Profile
@yanqiw
yanqiw / tmux.md
Created September 20, 2021 04:04 — 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

@yanqiw
yanqiw / scrollTo.js
Created February 10, 2019 07:59 — forked from joshcanhelp/scrollTo.js
Animated scrollTo for specific element or top of page
//
// Smooth scroll-to inspired by:
// http://stackoverflow.com/a/24559613/728480
//
module.exports = function (scrollTo, scrollDuration) {
//
// Set a default for where we're scrolling to
//
@yanqiw
yanqiw / detect-js-framework.js
Created May 3, 2018 11:23 — forked from rambabusaravanan/detect-js-framework.js
Detect JS Framework used in a Website
// Pase these lines into website's console ( Ctrl/Cmd + Shift + I )
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]'))
console.log('React.js');
if(!!window.angular ||
!!document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]') ||
!!document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]'))
console.log('Angular.js');
@yanqiw
yanqiw / gen_uid.js
Last active December 14, 2015 10:19 — forked from cyjake/gen_uid.js
// 还需要了解的:
// - 什么是 UID
// - 这四种方式优劣
function getId() {
return "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".replace(/x/g, function() {
return Math.floor(Math.random()*16).toString(16).toUpperCase();
});
}