Skip to content

Instantly share code, notes, and snippets.

View ryanlid's full-sized avatar
🎯
Focusing

ryanlid ryanlid

🎯
Focusing
View GitHub Profile
@ryanlid
ryanlid / index.html
Created September 22, 2017 15:19
启用HTTPS访问,禁用HTTP访问提示页
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>The HTTP access had been disabled!</title>
</head>
@ryanlid
ryanlid / google-fonts-proxy
Created November 17, 2017 02:34 — forked from gaoyifan/google-fonts-proxy
google-fonts-proxy
server {
listen 80;
listen 443;
listen [::]:80;
listen [::]:443;
server_name fonts.lug.ustc.edu.cn;
access_log /var/log/nginx/revproxy_access.log;
error_log /var/log/nginx/revproxy_error.log;
@ryanlid
ryanlid / http&https.js
Last active June 3, 2018 17:02
node下载文件资源
var fs = require('fs')
var http = require('http');
var https = require('https');
/**
* @param {String} url 下载链接
* @param {String} localFile 本地保存路径
* @param {function} callback
*/
@ryanlid
ryanlid / spider.js
Created November 23, 2017 06:38
爬虫js
const superagent = require('superagent');
const url = {
'login_url': 'http://example.com'
}
let loginInfo = {
"IsRemember": "true",
"loginName": "admin",
"loginPwd":'123456'
@ryanlid
ryanlid / live-server.md
Created December 11, 2017 05:35
将指定域名访问代理本地地址

将指定域名访问代理本地地址

live-server --proxy=/:http://loc.example.com/
@ryanlid
ryanlid / nginx.conf
Created January 6, 2018 08:15
nginx跨域配置
location / {
root /var/www/lidong.me/www;
index index.html index.htm index.php;
# 配置允许cors跨域
if ($http_origin ~ '^https?://(lidong.me)') {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
}
}
@ryanlid
ryanlid / .htaccess
Created January 9, 2018 17:18
wordpress .htaccess setting
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
@ryanlid
ryanlid / .cnpmrc
Last active April 20, 2018 08:19
nodejs相关的配置文件
registry=https://registry.npm.taobao.org
#registry=https://npmreg.mirrors.ustc.edu.cn
@ryanlid
ryanlid / pip.conf
Last active August 18, 2019 05:58
python 配置文件
# ~/.pip/pip.conf
[global]
index-url = https://mirrors.ustc.edu.cn/pypi/web/simple
# index-url = https://pypi.douban.com/simple
# index-url = https://mirrors.aliyun.com/pypi/simple
[install]
trusted-host=mirrors.aliyun.com
@ryanlid
ryanlid / .vimrc
Created January 16, 2018 13:49
vim 配置文件
"引号为注释
"设置显示行号
set nu
"设置在命令行界面最下面显示当前模式
set showmode
"在右下角显示光标所在的行数等信息
set ruler
"设置每次单击Enter键后,光标移动到下一行时与上一行的起始字符对齐
set autoindent
"设置TAB宽4个空格