Skip to content

Instantly share code, notes, and snippets.

View ryanlid's full-sized avatar
🎯
Focusing

ryanlid ryanlid

🎯
Focusing
View GitHub Profile
@Stanback
Stanback / nginx.conf
Last active May 3, 2024 12:01 — forked from michiel/cors-nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
#
# CORS header support
#
# One way to use this is by placing it into a file called "cors_support"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
#
# include cors_support;
#
# As of Nginx 1.7.5, add_header supports an "always" parameter which
@massar
massar / server-git.conf
Created March 6, 2014 21:14
Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# Example nginx + git HTTP Smart mode (git-http-backend) + HTTP Authentication + HTTPS redirect
# jeroen@massar.ch - http://jeroen.massar.ch
server {
listen 192.0.1.1:80;
listen [2001:db8::1]:80;
# Redirect all non-HTTPS traffic to the HTTPS variant
return 301 https://$host$request_uri;
}
@ccbikai
ccbikai / m163player.php
Created July 28, 2014 06:24
WordPress快速插入网易云音乐
function wp_iframe_handler_m163( $matches, $attr, $url, $rawattr ) {
$iframe = '<iframe width="430" height="200" src="http://miantiao.jd-app.com/m163player/'. esc_attr($matches[1]) . '" allowtransparency scrolling="0" frameborder="0" ></iframe>';
return apply_filters( 'iframe_m163', $iframe, $matches, $attr, $url, $rawattr );
}
wp_embed_register_handler( 'm163_iframe', '#http://music.163.com/\#/song\?id=([\d]+)(.*?)#i', 'wp_iframe_handler_m163' );
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active April 25, 2024 22:55
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@JustThomas
JustThomas / wordpress-multisite-internal-redirect-loop.md
Last active March 27, 2024 14:45
WordPress Multisite: How to fix error "too many redirects"

WordPress Multisite: How to fix error "Request exceeded the limit of 10 internal redirects"

I am running a WordPress multisite network with sub-directory setup. When I check my error.log file, it is full of entries like this one:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'Limit InternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

The problem was, in my case, one specific rewrite rule in the .htaccess file.

Problem description

@PurpleBooth
PurpleBooth / README-Template.md
Last active May 6, 2024 07:22
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

原文

新老用户都可能遇到陷阱。下面我们列出频繁出现的问题,以及如何解决。 在 Freenode IRC #nginx 频道,我们经常看到这些问题。

[TOC]

关于本指南

最常见的是有人试图从其他指南拷贝配置片段。并非所有的指南是错误的,但绝大部分是有问题的。

@ryanlid
ryanlid / .editorconfig
Last active May 2, 2017 11:19
EditorConfig是一套用于统一代码格式的解决方案
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@nealnote
nealnote / multiofflinetask.js
Last active September 2, 2017 06:10
multi offline task add for pan.baidu.com
/**
* multi offline task add for pan.baidu.com
* 执行代码前必须 点一下 **离线下载** 按钮
**/
(function () {
var R = require('function-widget-1:offlineDownload/util/newOfflineDialog.js');
var r = R.obtain();
var timer = 600;
var add = function (url) {
r.setVisible(1);