Skip to content

Instantly share code, notes, and snippets.

@justqyx
justqyx / zshrc
Last active August 15, 2016 01:38
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
@justqyx
justqyx / Preferences.sublime-settings
Last active October 26, 2016 08:49
My Sublime Text Confirguration
{
"color_scheme": "Packages/Material Theme/schemes/OLD/Material-Theme-Darker.tmTheme",
"default_encoding": "UTF-8",
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
@justqyx
justqyx / microsoft_office_2016_for_mac.txt
Created March 22, 2016 03:42
microsoft_office_2016_for_mac
http://news.mydrivers.com/1/438/438769.htm
FactoryGirl.define do
sequence(:mock_image) do |n|
{
tempfile: StringIO.new('{・㉨・}'),
filename: "#{n}.png",
original_filename: "#{n}.png",
content_type: 'image/png'
}
end
end

性能数据收集

I, [2016-06-04T15:31:39.244351 #19896]  INFO -- : GET Rails::WelcomeController#index html 200 6.783 6.53 0
I, [2016-06-04T15:31:42.075029 #19896]  INFO -- : GET Rails::WelcomeController#index html 200 0.88 0.6859999999999999 0
I, [2016-06-04T15:31:44.011523 #19896]  INFO -- : GET Rails::WelcomeController#index html 200 0.8310000000000001 0.638 0
I, [2016-06-04T15:31:45.531931 #19896]  INFO -- : GET Rails::WelcomeController#index html 200 0.728 0.5900000000000001 0

提取数据的正则表达式

中国大陆手机号码,目前支持的号码段

  • 中国移动:134/135/136/137/138/139/150/151/152/157/159/187/188
  • 中国联通:130/131/132/155/156/186/185
  • 中国电信:133/153/189/180
/^(130|131|132|133|134|135|136|137|138|139|150|151|152|153|155|156|157|158|159|180|186|187|188|189)/d{8}$/
http://pdf.th7.cn/down/files/1312/refactoring_ruby_edition.pdf
@justqyx
justqyx / gist:9a100165a8cb05b8b95140ef2fbf06d7
Created July 13, 2016 12:54 — forked from jugyo/gist:3882497
nginx + ngx_lua on Mac
(function(){
window.requestAnimFrame = (function(){
return function( callback ){
window.setTimeout(callback, 1000 / 25);
};
})();
//判断是否支持canvas
var isCanvas=function(){
try{
document.createElement('canvas').getContext('2d');
@justqyx
justqyx / manage-etc-hosts.sh
Last active August 10, 2021 16:50 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTLINE=$2