Skip to content

Instantly share code, notes, and snippets.

@chrisswanda
chrisswanda / WireGuard_Setup.txt
Last active May 23, 2024 20:31
Stupid simple setting up WireGuard - Server and multiple peers
Install WireGuard via whatever package manager you use. For me, I use apt.
$ sudo add-apt-repository ppa:wireguard/wireguard
$ sudo apt-get update
$ sudo apt-get install wireguard
MacOS
$ brew install wireguard-tools
Generate key your key pairs. The key pairs are just that, key pairs. They can be
@verticalgrain
verticalgrain / app.js
Last active April 26, 2022 15:37
React Router V4 Redirect after form submission
import React, { Component } from 'react'
import { Redirect } from 'react-router'
export default class ContactForm extends Component {
constructor () {
super();
this.state = {
fireRedirect: false
}
}
[Proxy]
WIFI = direct, interface=en2
VPN = direct, interface=utun0
[Rule]
DOMAIN-SUFFIX,yach.me,WIFI
FINAL,VPN
@jason5ng32
jason5ng32 / surge.conf
Last active April 7, 2024 13:04
Surge Configs ( for 2.x )
[General]
loglevel = notify
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, ::ffff:0:0:0:0/1, ::ffff:128:0:0:0/1
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
# dns-server = 119.29.29.29,223.5.5.5,114.114.115.115
# external-controller-access = PASSWORD@0.0.0.0:6155
# ipv6 = true
// REMEMBER TO CHANGE THE external-controller-access' PASSWORD
@DarrylDias
DarrylDias / pagekit.conf
Last active January 3, 2023 15:49
NGINX config for PageKit. (Tested on Ubuntu) (If for some reason I don't reply to a comment leave a message at https://darryldias.me/contact/)
server {
# Server name
server_name example.com;
# Server Port
listen 80;
# Webroot
root /var/www/;
@willerce
willerce / ResLoader.js
Last active July 3, 2018 14:01
保存 Javascript 和 CSS 到 LocalStorage 中
var Loader = (function () {
function Loader(options) {
this.options = options;
if (resource.scripts && resource.baseUrl) {
for (var i = 0; i < this.options.scripts.length; i++) {
this.load('js', this.options.scripts[i]);
}
for (var i = 0; i < this.options.stylesheets.length; i++) {
this.load('css', this.options.stylesheets[i]);
}
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #