Skip to content

Instantly share code, notes, and snippets.

🤔
I may be slow to respond.

安正超 overtrue

🤔
I may be slow to respond.
Block or report user

Report or block overtrue

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:f540fbea3c33e3da53fd
<!DOCTYPE html> <!-- 使用 HTML5 doctype,不区分大小写 -->
<html lang="zh-cmn-Hans"> <!-- 更加标准的 lang 属性写法 http://zhi.hu/XyIa -->
<head>
<!-- 声明文档使用的字符编码 -->
<meta charset='utf-8'>
<!-- 优先使用 IE 最新版本和 Chrome -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<!-- 页面描述 -->
<meta name="description" content="不超过150个字符"/>
<!-- 页面关键词 -->
@overtrue
overtrue / init.fish
Last active Nov 4, 2019 — forked from alyssaq/config.fish
config.fish set environment variables from bash_profile
View init.fish
# 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"
View KillWeiboDogs.js
// 1. 使用 chrome 打开 weibo.com (确保你登录了微博)
// 2. 打开调试窗口,在 console 中贴下面的代码后回车
// 数据来自:https://github.com/yu961549745/WeiboBlackList
let dogs = [ 5471246591, 5209943797, 1709070650, 1887921907, 1824515351, 6031549751, 3477430640, 5303365027, 2397004535, 5014141958, 2357033797, 2253196910, 1282371413, 5433169859, 5577097996, 2477460747, 5791757379, 3973075219, 5480191060, 5064046310, 1794010902, 5241254653, 1775613335, 1749775825, 2898929101, 1766122373, 5330205046, 5836217079, 2143736030, 5088125436, 2122838230, 2379528185, 5768433920, 1588830357, 2734746975, 1702267517, 3305446403, 1922854483, 2240459775, 1713064495, 3141318761, 3049734521, 1297708027, 1670201221, 1113091931, 2682353630, 1889031894, 5736617825, 5573535479, 1787098822, 5474940961, 2647495542, 1978558182, 5675487085, 2066669447, 1410124131, 3318338712, 5117947348, 5984813988, 1935760780, 2106405744, 1658278557, 3123751063, 2418980745, 5612086708, 2822792580, 2728966594, 5651704821, 3174983660, 2884830430, 1409910532, 5289026864, 5460203843, 30409
View hang-tag.xml
<?xml version="1.0" encoding="UTF-8"?>
<page xmlns="http://cloudprint.cainiao.com/print" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cloudprint.cainiao.com/print http://cloudprint-docs-resource.oss-cn-shanghai.aliyuncs.com/lpml_schema.xsd" xmlns:editor="http://cloudprint.cainiao.com/schema/editor" width="45" height="70" splitable="false">
<layout width="37" height="6" left="4" top="5">
<barcode type="code128" ratioMode="keepRatio">
<![CDATA[<%= _data.item_no %>]]>
</barcode>
</layout>
<layout width="37" left="4" top="13">
<table width="37" style="borderWidth:0;cellBorderWidth:0;">
<tr>
@overtrue
overtrue / date-preg-match.php
Last active Apr 1, 2019
匹配文本中的日期部分
View date-preg-match.php
<?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',
View gist:0bf1cd704bf804de2e2c
<?php
error_reporting(1);
$target = __DIR__ . '/../website.com'; // 生产环境web目录
$token = '您在coding填写的hook令牌';
$wwwUser = 'apache';
$wwwGroup = 'apache';
$json = json_decode(file_get_contents('php://input'), true);
View _utils.scss
// Mobile project scss utils.
// https://gist.github.com/overtrue/56561fd4b124b9ffe5048ef06752d4bf
// Space
//
$spacer: 12px !default;
@each $prop, $abbrev in (margin: m, padding: p) {
@for $size from 0 to 10 {
$value: #{$size * $spacer};
@overtrue
overtrue / .gitconfig
Created Feb 22, 2019
git conditional includes
View .gitconfig
[includeIf "gitdir:~/www/"]
path = .gitconfig-personal
[includeIf "gitdir:~/work/"]
path = .gitconfig-work
// .gitconfig-personal
[user]
email=xxxx@personal.com
@overtrue
overtrue / .gitignore
Created May 31, 2016
global gitignore
View .gitignore
# 设置方法:
# git config --global core.excludesfile ~/.gitignore_global
#compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
View Preferences.sublime-settings
{
"always_show_minimap_viewport": true,
"atomic_save": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
You can’t perform that action at this time.