绝大多数服务器,都不允许静态文件响应POST请求(GET请求静态文件是天经地义的),否则会返回HTTP/1.1 405 Method not allowed
错误。
然而在前端开发中,前端开发工程师经常模拟后端请求,返回静态数据来查看页面效果,怎么办?
目前有两种方案解决:
/** | |
* Include Roboto Condensed font in your project | |
* | |
* Download Roboto Condensed ttf files from Google Fonts and place it in the same directory of this CSS file | |
* You can then use this font in your project by setting | |
* font-face: "Roboto Condensed", Helvetica, Arial, sans-serif; | |
* | |
* @author Mattia Migliorini (deshack) | |
* @license MIT | |
*/ |
##ss-redir 的 iptables 配置(透明代理)
透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则
创建 /etc/ss-redir.json 本地监听 7777
运行ss-redir -v -c /etc/ss-redir.json
iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
package mobi.bbase.ahome.utils; | |
import java.io.ByteArrayOutputStream; | |
import java.util.Random; | |
/** | |
* 加密解密QQ消息的工具类. QQ消息的加密算法是一个16次的迭代过程,并且是反馈的,每一个加密单元是8字节,输出也是8字节,密钥是16字节 | |
* 我们以prePlain表示前一个明文块,plain表示当前明文块,crypt表示当前明文块加密得到的密文块,preCrypt表示前一个密文块 | |
* f表示加密算法,d表示解密算法 那么从plain得到crypt的过程是: crypt = f(plain ˆ preCrypt) ˆ |
These rules are adopted from the AngularJS commit conventions.
# Version key/value should be on his own line | |
PACKAGE_VERSION=$(cat package.json \ | |
| grep version \ | |
| head -1 \ | |
| awk -F: '{ print $2 }' \ | |
| sed 's/[",]//g') | |
echo $PACKAGE_VERSION |
// Mixins | |
.has(@element; @content) { | |
&__@{element} { | |
@content(); | |
} | |
} | |
.variant(@modifier; @content) { | |
&--@{modifier} { | |
@content(); |
import sys | |
import re | |
import os | |
if os.path.isfile(sys.argv[2]): | |
os.remove(sys.argv[2]) | |
eudic = open(sys.argv[1]) | |
anki = open(sys.argv[2], 'a') |
SPC s c remove highlight | |
**** Files manipulations key bindings | |
Files manipulation commands (start with ~f~): | |
| Key Binding | Description | | |
|-------------+----------------------------------------------------------------| | |
| ~SPC f c~ | copy current file to a different location | | |
| ~SPC f C d~ | convert file from unix to dos encoding | | |
| ~SPC f C u~ | convert file from dos to unix encoding | |
If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:
$ git config --global commit.gpgsign true
([OPTIONAL] every commit will now be signed)$ git config --global user.signingkey ABCDEF01
(where ABCDEF01
is the fingerprint of the key to use)$ git config --global alias.logs "log --show-signature"
(now available as $ git logs
)$ git config --global alias.cis "commit -S"
(optional if global signing is false)$ echo "Some content" >> example.txt
$ git add example.txt
$ git cis -m "This commit is signed by a GPG key."
(regular commit
will work if global signing is enabled)