Skip to content

Instantly share code, notes, and snippets.

View maboloshi's full-sized avatar

沙漠之子 maboloshi

  • 17:49 (UTC +08:00)
View GitHub Profile
@bmhatfield
bmhatfield / .profile
Last active January 29, 2025 11:11
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@cyanife
cyanife / Shadowsocks服务端性能优化.md
Created April 7, 2016 07:21
Shadowsocks服务端性能优化

#Shadowsocks服务端性能优化(CentOS6)

##ss加密算法 常用算法aes-256-cfb速度较慢,在路由器等arm平台表现不佳。 用于arm平台时,采用算法rc4-md5即可。 "method":"rc4-md5" 为加速加密速度,安装m2crypto

yum install m2crypto
@zhoujiealex
zhoujiealex / gulpfile.js
Last active April 19, 2018 02:29
sample of gulpfile.js for hexo generate blog, compress public files
/* Refrences:
1. http://notes.iissnan.com/2016/publishing-github-pages-with-travis-ci
2. https://github.com/chrisjlee/hexo-theme-zurb-foundation/blob/e82f45a82bbaaee063bcb1298cd9793575afb142/gulpfile.js
3. https://github.com/gulpjs/gulp/blob/master/docs/recipes/delete-files-folder.md
4. https://hexo.io/api/
5. https://github.com/iissnan/theme-next-docs/blob/master/.travis.yml
*/
var gulp = require('gulp');
var minifycss = require('gulp-clean-css');
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 6, 2025 20:45
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@oa414
oa414 / ByeZhihuSecurity.js
Last active November 10, 2021 08:05
去除知乎点开外链的安全中心跳转
// ==UserScript==
// @name ByeZhihuSecurity
// @namespace http://tampermonkey.net/
// @version 0.1
// @description 去除知乎点开外链的安全中心跳转
// @author Lin Xiangyu
// @match https://www.zhihu.com/*
// @grant none
// ==/UserScript==
@Liam0205
Liam0205 / ltxtest.tex
Created August 23, 2016 04:32
minted in mdframed and tikz node, with new environment
\documentclass[UTF8, openany,twoside]{ctexbook}
\usepackage{minted}
\usepackage[tikz]{bclogo,rotating}
\usepackage{tikz}
\usepackage{mdframed}
\usepackage{geometry}
\usetikzlibrary{calc}
\DeclareGraphicsRule{.mps}{eps}{.mps}{}
@stefanbuck
stefanbuck / upload-github-release-asset.sh
Last active August 27, 2024 08:46
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
$('.load-gist').on('click', function() {
var gist = {
// URL 传参自己改下
url: '//gist.github.com/printempw/' + $(this).data('hash') + '.json?callback=?',
dom: this
}
// 因为 URL 中带了 `callback=?`,所以这里 jQuery 会使用 JSONP 方式请求
$.getJSON(gist.url, function(data) {
// 加载样式
@ravibhure
ravibhure / git_rebase.md
Last active April 11, 2025 09:30
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

@prinsss
prinsss / page.html
Created December 17, 2016 09:58
Click button to load Disqus
<a class="btn btn-default" href="javascript:disqus.load();">点击以加载 Disqus</a>