Skip to content

Instantly share code, notes, and snippets.

View 0xDing's full-sized avatar
👨‍💻
I may be slow to respond.

Li Ding 0xDing

👨‍💻
I may be slow to respond.
View GitHub Profile

MashCard Contributor License Agreement

Thank you for your interest in contributing software code to a project hosted or managed by Brickdoc Inc or any of its affiliates (“Brickdoc”). In order to clarify the intellectual property license granted with Contributions from any person or entity, Brickdoc must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This version of the Contributor License Agreement allows an individual to submit Contributions to the applicable project. Please read this document carefully before signing and keep a copy for your records.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Brickdoc. Except for the license granted herein to Brickdoc and recipients of software distributed by Brickdoc, You reserve all right, title, and interest in and to Your Contributions.

1.Definitions.

"You" (or "Your") shall mean the copyright

port: 7890
socks-port: 7891
redir-port: 7892
allow-lan: true
mode: Rule
log-level: info
external-controller: 0.0.0.0:9090
secret: "xxxxxx"
dns:
enable: true
@0xDing
0xDing / .zshrc
Created August 10, 2019 09:33
oortcast macos-init zshrc
# If you come from bash you might have to change your $PATH.
export XDG_CONFIG_HOME="/Users/ding/.config"
# Path to your oh-my-zsh installation.
export ZSH="/Users/ding/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="sunaku-zen"
@0xDing
0xDing / appcenter_push_api_ruby_sdk.rb
Created May 21, 2019 17:28
visual studio app center push notifications ruby sdk
# frozen_string_literal: true
class MicrosoftAppcenterPushService
include HTTParty
base_uri 'https://appcenter.ms/api/v0.1/apps'
OWNER = 'your org name'
APP_NAME = 'your app name'
def initialize
@header = {
@0xDing
0xDing / install.sh
Created March 26, 2019 15:02
api reverse proxy
# ubuntu18.04
# enabel BBR
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
# networking opt
sed -i '/^net.core.netdev_max_backlog/ d' /etc/sysctl.conf
echo "net.core.netdev_max_backlog = 2000" >>/etc/sysctl.conf
@0xDing
0xDing / pg2s3.sh
Created January 6, 2019 07:03
backup postgresql database to aws s3
#!/bin/sh
CURRENT=`date +%s`
HOST="xxx.rds.amazonaws.com"
S3BUCKET = 'XXX'
DUMP="${DB}.${CURRENT}-full.tar"
echo "starting dump datbase..."
pg_dump -h ${HOST} -p 5432 -U ${USER} -w -d ${DB} -O -v -F tar -f ${DUMP}
@0xDing
0xDing / decrypt.sh
Created January 2, 2019 08:05
Decrypt Office 2003
#!/usr/bin/env bash
echo -n $'\E[31m'
echo $''
echo $' _,.'
echo $' ,` -.)'
echo $' \'( _/\'-\\\\-.'
echo $' /,|`--._,-^| ,'
echo $' \\_| |`-._/|| ,\'|'
echo $' | `-, / | / /'
@0xDing
0xDing / ga_proxy.conf
Last active May 18, 2017 20:03
Google Analytics Proxy
server {
listen 443 http2 ssl;
server_name analytics.example.com;
location /ga_proxy {
proxy_set_header X-real-ip $remote_addr;
rewrite ^/ga_proxy/(.*)$ /$1?$args&uip=$remote_addr;
proxy_pass http://www.google-analytics.com;
break;
}
location /analytics.js {
@0xDing
0xDing / form.html.erb
Created January 4, 2017 14:57
Rails FormBuilder @ Gridforms
<%= lud_gridforms_for(@organization) do |f| %>
<%= f.row_for do %>
<%= f.text_field :name %>
<%= f.text_field :alias %>
<%= f.spec_info_select :characteristics, {span: 2}, {multiple: true} %>
<% end %>
<%= f.row_for do %>
<%= f.url_field :website %>
<%= f.spec_info_check_boxes :currencies %>
@0xDing
0xDing / seajs-jquery-adaptor.js
Created January 18, 2014 13:12
让seajs根据浏览器版本加载适合的jquery库,等效于<!--[if lt IE 9]><script src="jquery-1.9.0.js"></script> <![endif]--><!--[if gte IE 9]><!--><script src="jquery-2.0.0.js"><</script> <!--<![endif]-->
var h5 = -[1,]; //判断是否为现代浏览器
seajs.config({
alias: {
'jquery': 'libs/jquery'+(h5 ? '2.0.3' : '1.10.2')+'/jquery'
},
});