Skip to content

Instantly share code, notes, and snippets.

View overtrue's full-sized avatar
🎯
Focusing

安正超 overtrue

🎯
Focusing
View GitHub Profile
@overtrue
overtrue / date-preg-match.php
Last active April 1, 2019 17:40
匹配文本中的日期部分
<?php
$cases = [
'明年,1月1日下午2:30,test',
'二零一七年,1月1日下午2:30,test',
'今年,12月1日下午2:30,test',
'嘎嘎嘎,1月1日下午2:30,test',
'2016年,1月1日下午2:30,test',
'20161月1日下午2:30,test',
'20161月1日上午2:30,test',
@overtrue
overtrue / Preferences.sublime-settings
Last active February 16, 2019 08:11
Sublime Setting
{
"always_show_minimap_viewport": true,
"atomic_save": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
<?php
var_dump(substr_count(file_get_contents('http://106.75.28.160/UCloud.txt'), 'UCanUup'));
// int(728)
@overtrue
overtrue / .gitignore
Created May 31, 2016 12:00
global gitignore
# 设置方法:
# git config --global core.excludesfile ~/.gitignore_global
#compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Install dependencies
#
# * checkinstall: package the .deb
# * libpcre3, libpcre3-dev: required for HTTP rewrite module
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \
mkdir -p ~/sources/ && \
# Compile against OpenSSL to enable NPN
JPEG2000 image files,00 00 00 0C 6A 50 20 20,JP2,Picture
3GPP multimedia files,00 00 00 14 66 74 79 70,3GP,Multimedia
MPEG-4 v1,00 00 00 14 66 74 79 70 69 73 6F 6D,MP4,Multimedia
3rd Generation Partnership Project 3GPP,00 00 00 14 66 74 79 70,3GG|3GP|3G2,Multimedia
Windows Disk Image,00 00 00 00 14 00 00 00,TBI,Windows
MPEG-4 video_1,00 00 00 18 66 74 79 70,3GP5|M4V|MP4,Multimedia
MPEG-4 video_2,00 00 00 1C 66 74 79 70,MP4,Multimedia
3GPP2 multimedia files,00 00 00 20 66 74 79 70,3GP,Multimedia
Apple audio and video,00 00 00 20 66 74 79 70 4D 34 41,M4A,Multimedia
3rd Generation Partnership Project 3GPP2,00 00 00 20 66 74 79 70,3GG|3GP|3G2,Multimedia
@overtrue
overtrue / StringExtension.swift
Last active August 22, 2016 06:55
Swift Extensions
import Foundation
extension String {
var length: Int {
return (self as NSString).length
}
func split(separator: Character) -> [String] {
return self.characters.split { $0 == separator }.map(String.init)
}
#! /bin/bash
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
#
# processname: nginx
# config: /etc/nginx/nginx.conf
@overtrue
overtrue / init.fish
Last active December 6, 2023 05:24 — forked from alyssaq/config.fish
config.fish set environment variables from bash_profile
# Fish shell
egrep "^export " ~/.bash_profile | while read e
set var (echo $e | sed -E "s/^export ([A-Za-z_]+)=(.*)\$/\1/")
set value (echo $e | sed -E "s/^export ([A-Za-z_]+)=(.*)\$/\2/")
# remove surrounding quotes if existing
set value (echo $value | sed -E "s/^\"(.*)\"\$/\1/")
if test $var = "PATH"
@overtrue
overtrue / surge_main.conf
Created October 27, 2015 07:57 — forked from jason5ng32/surge.conf
Surge Configs ( Both 2 files are needed )
[General]
loglevel = notify
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
bypass-tun = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12,127.0.0.0/24,100.64.0.0/10
// DNS OVERRIDE, REMOVE # IF YOU NEED
# dns-server = 223.6.6.6,223.5.5.5,114.114.114.114,114.114.115.115
[Rule]