Skip to content

Instantly share code, notes, and snippets.

View jerrylau91's full-sized avatar
🎯
Focusing

debuluoooo jerrylau91

🎯
Focusing
View GitHub Profile
@jerrylau91
jerrylau91 / iterm-profile.json
Created November 19, 2022 22:44
iTerm Profile Settings
{
"Use Non-ASCII Font" : true,
"Tags" : [
],
"Ansi 12 Color" : {
"Green Component" : 0.57647058823529407,
"Blue Component" : 0.97647058823529409,
"Red Component" : 0.74117647058823533
},
@jerrylau91
jerrylau91 / rem.js
Created August 3, 2021 09:11
移动端 REM 适配方案
;(function (designWidth, maxWidth) {
var doc = document,
win = window;
var docEl = doc.documentElement;
var tid;
var rootItem, rootStyle;
function refreshRem() {
var width = docEl.getBoundingClientRect().width;
if (!maxWidth) {
@jerrylau91
jerrylau91 / .bash_profile
Created February 10, 2020 09:12 — forked from jonsuh/.bash_profile
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
@jerrylau91
jerrylau91 / mobile-layout.js
Created October 23, 2019 11:21
手机端页面自适应解决方案—rem布局进阶版
/**
* @param {Boolean} [normal = false] - 默认开启页面压缩以使页面高清;
* @param {Number} [baseFontSize = 100] - 基础fontSize, 默认100px;
* @param {Number} [fontscale = 1] - 有的业务希望能放大一定比例的字体;
*/
const win = window;
export default win.flex = (normal, baseFontSize, fontscale) => {
const _baseFontSize = baseFontSize || 100;
const _fontscale = fontscale || 1;
@jerrylau91
jerrylau91 / curl.md
Created January 28, 2018 08:53 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@jerrylau91
jerrylau91 / .zshrc
Created December 14, 2017 02:21
my zsh config
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@jerrylau91
jerrylau91 / .eslintrc
Last active November 30, 2017 12:46
eslint rules based airbnb javascript style guide
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"airbnb" // 以社区广泛使用的 airbnb 风格指南作为基础
],
@jerrylau91
jerrylau91 / rewrite-nginx-server.conf
Created August 30, 2017 06:50
remove html extension and trailing slash with nginx
server {
listen 80;
server_name test.com *.test.com;
rewrite ^(/.*)\.html(\?.*)?$ $1$2 permanent;
rewrite ^/(.*)/$ /$1 permanent;
root /path/to/project/root;
index index.html;
try_files $uri/index.html $uri.html $uri/ $uri =404;
@jerrylau91
jerrylau91 / JS-Function-Bind
Created August 25, 2017 07:53
JS Function.prototype.bind usage
## What does Function.prototype.bind do ?
Function.prototype.bind = function (scope) {
if (typeof this !== "function") {
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var fn = this;
return function () {
return fn.apply(scope);
@jerrylau91
jerrylau91 / phpdemo.conf
Last active August 24, 2017 06:24
Nginx PHP configuration
server {
listen 8090;
server_name localhost;
root /Users/jerryliu/Coding/myapp/phpdemo01;
index index.php index.html index.htm;
autoindex off;
location / {
try_files $uri $uri/ /index.php;