Skip to content

Instantly share code, notes, and snippets.

View suxiaogang's full-sized avatar
🙄
busy writing bugs

Sam Su suxiaogang

🙄
busy writing bugs
  • NULL
  • UTM Zone 49
View GitHub Profile
@suxiaogang
suxiaogang / macos sierra允许任何来源选项
Created July 28, 2017 02:29
macos sierra允许任何来源选项
在终端输入:
sudo spctl --master-disable
然后即可在安全选项中看到重新出现的允许任何来源选项!
# 规则配置仅供参考,适用于 Surge Mac (1.3.2) 及其后续版本;
# 包含 Proxy Group、URL Rewrite 特性;
# 包含 Reject 规则,用于拦截广告、行为分析、数据统计;
# 屏蔽 Hao123、百度联盟广告以及部分运营商网页漂浮广告;
# Surge for Mac 简明指南 http://bit.ly/1TATRaG
[General]
# warning, notify, info, verbose
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
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12
loglevel = notify
/*Bootstrap modal size*/
@media (max-width: 1280px){
.modal-dialog {
height:630px;
width:800px;
}
.modal-body {
height: 500px;
}
}
#!/bin/sh
#================================================
# backup mysql
#================================================
# set up all the mysqldump options
FILE=backup_`date +"%Y%m%d_%H_%M"`_structure.sql
DATABASE=DBNAME
USER=root
@suxiaogang
suxiaogang / gist:1e5461afe399414654d5
Last active January 26, 2016 09:47
Jackson & POJO
String str = "[{\"catId\":\"55e7479ae4b043f0f65c010f\",\"orderId\":1},{\"catId\":\"55ede02ae4b092d8492030c1\",\"orderId\":2},{\"catId\":\"55ede04ae4b092d8492030c3\",\"orderId\":3},{\"catId\":\"567203210cf23be06e8b8cc4\",\"orderId\":4}]";
ObjectMapper mapper = new ObjectMapper();
List<Dummy> list = mapper.readValue(param, new TypeReference<List<Dummy>>(){});
private static class Dummy{
String catId;
int orderId;
public String getCatId() {
return catId;
@suxiaogang
suxiaogang / Vertically centering Bootstrap modal window
Created January 7, 2016 06:45
Vertically centering Bootstrap modal window
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">Launch demo modal</button>
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="vertical-alignment-helper">
<div class="modal-dialog vertical-align-center">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
@suxiaogang
suxiaogang / iptables
Created December 25, 2015 10:00
iptables for mongodb
# Generated by iptables-save v1.4.7 on Thu Jan 22 12:02:20 2009
*filter
:INPUT DROP [62:7014]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [212:25039]
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
# -*- coding:utf-8 -*-
__author__ = 'Delbert'
# Using Python3
# beautifulsoup4 is needed.
from bs4 import BeautifulSoup
from urllib import request
import os
def main():
begin_page = int(input("From: "))
@suxiaogang
suxiaogang / nginx.conf
Created March 20, 2015 05:46
Nginx nginx.conf
user www www;
worker_processes auto;
error_log /vps_log/nginx_error.log crit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
@suxiaogang
suxiaogang / server.xml
Created March 20, 2015 05:45
Tomcat server.xml
<?xml version='1.0' encoding='utf-8'?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0