Skip to content

Instantly share code, notes, and snippets.

@MirrorDM
MirrorDM / freeip.pac
Last active March 13, 2016 05:32
PAC for CERNET free ip. 教育网 免费地址 PAC
function FindProxyForURL(url, host) {
var socks = "SOCKS5 127.0.0.1:8888; SOCKS 127.0.0.1:8888; DIRECT;";
if (isInNet(dnsResolve(host), "1.51.0.0", "255.255.0.0") || isInNet(dnsResolve(host), "1.184.0.0", "255.254.0.0") || isInNet(dnsResolve(host), "42.244.0.0", "255.252.0.0") || isInNet(dnsResolve(host), "49.52.0.0", "255.252.0.0") || isInNet(dnsResolve(host), "49.120.0.0", "255.252.0.0") || isInNet(dnsResolve(host), "49.140.0.0", "255.254.0.0") || isInNet(dnsResolve(host), "49.208.0.0", "255.254.0.0") || isInNet(dnsResolve(host), "58.17.0.0", "255.255.0.0") || isInNet(dnsResolve(host), "58.24.0.0", "255.254.0.0") || isInNet(dnsResolve(host), "58.154.0.0", "255.254.0.0") || isInNet(dnsResolve(host), "58.192.0.0", "255.240.0.0") || isInNet(dnsResolve(host), "58.240.0.0", "255.254.0.0") || isInNet(dnsResolve(host), "59.32.0.0", "255.240.0.0") || isInNet(dnsResolve(host), "59.64.0.0", "255.240.0.0") || isInNet(dnsResolve(host), "60.0.0.0", "255.224.0.0") || isInNet(dnsResolve(host), "60.63.0.0", "255.25
@MirrorDM
MirrorDM / BIT.cpp
Last active August 29, 2015 14:04
Binary Index Tree 树状数组 多维
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAXN 100
using namespace std;
int indextree[MAXN+1] = {};
int indexmatrix[MAXN+1][MAXN+1] = {};
//求2^k
@MirrorDM
MirrorDM / boxmuller.c
Last active September 25, 2015 04:03
Generating Gaussian Random Numbers. Implements the Polar form of the Box-Muller Transformation.
/* boxmuller.c Implements the Polar form of the Box-Muller
Transformation
(c) Copyright 1994, Everett F. Carter Jr.
Permission is granted by the author to use
this software for any application provided this
copyright notice is preserved.
*/
@MirrorDM
MirrorDM / Main.conf
Created October 26, 2015 11:34
Yet another config for Surge.app
[General]
# warning, notify, info, verbose
loglevel = notify
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
dns-server = 114.114.114.114,119.29.29.29,8.8.8.8
[Proxy]
# http, https, socks5