Skip to content

Instantly share code, notes, and snippets.

# on 启用,off 关闭
pagespeed on;
# 重置 http Vary 头
pagespeed RespectVary on;
# html字符转小写
pagespeed LowercaseHtmlNames on;
# 压缩带 Cache-Control: no-transform 标记的资源
pagespeed DisableRewriteOnNoTransform off;
# 相对URL
pagespeed PreserveUrlRelativity on;
@danielpopdan
danielpopdan / README.md
Last active April 13, 2019 07:35 — forked from pfrenssen/README.md
Git hook to check coding standards using PHP CodeSniffer before pushing

About

This is a git pre-push hook intended to help developers keep their Drupal code base clean by performing a scan with Drupal Coder whenever new code is pushed to the repository. When any coding standards violations are present the push is rejected, allowing the developer to fix the code before making it public.

To increase performance only the changed files are checked when new code is

@karussell
karussell / preview-git-pull-request.txt
Last active April 30, 2019 17:10
Preview git merge
This is a lot easier: https://gist.github.com/piscisaureus/3342247
Step 1: Check out a new branch to test the changes — run this from your project directory
git checkout -b dajac-jsoup-1.7.1 master
Step 2: Bring in dajac's changes and test ('jsoup-1.7.1' acts as commit message)
git pull https://github.com/dajac/snacktory.git jsoup-1.7.1
@sumitpore
sumitpore / git merge using CLI.txt
Last active March 17, 2020 09:27
Merging Through CLI
git fetch origin
git checkout -b "source-branch" "origin/source-branch"
git checkout "origin/target-branch"
git merge --no-ff "source-branch"
git commit -m "Commit Message"
git push origin HEAD:target-branch
@tillkruss
tillkruss / worker.js
Created July 17, 2018 16:18
A Cloudflare worker that allow cookie/path based caching.
/**
* Time-to-live in seconds for cached requests.
*/
const cacheTtl = 300;
/**
* List of request paths to cache.
*/
const cachedPaths = [
@sumitpore
sumitpore / gist:aac8fc0b2b133c098c002fecc0ea88cd
Last active July 23, 2020 13:26
Git process to prevent overriding of other's code
git add .
git stash
git pull --rebase
git stash pop
git status
git commit
git push
@derekmd
derekmd / Optional.php
Last active October 17, 2021 10:25
Laravel global helper function `optional()`
<?php
namespace App\Support;
class Optional
{
/**
* The target being transformed.
* Use _ prefix to avoid namespace conflict on __get()
*
@DmitryMyadzelets
DmitryMyadzelets / index.html
Created November 20, 2016 14:37
Routing nginx + nodejs\expressjs + socket.io
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Chat</title>
<script src="./socket.io/socket.io.js"></script>
<script type="text/javascript">
@samselikoff
samselikoff / tailwind.config.js
Created April 16, 2021 15:57
Firefox plugin for Tailwind CSS. Add styles that target Firefox browser only.
const plugin = require("tailwindcss/plugin");
module.exports = {
mode: "jit",
purge: {
content: ["./src/**/*.{js,ts,jsx,tsx,mdx,vue}"],
},
theme: { extend: {} },
variants: {},
plugins: [