This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' defaults | |
' skinparam monochrome true | |
skinparam roundcorner 10 | |
skinparam shadowing false | |
skinparam DefaultFontName Proxima Nova | |
skinparam ArrowColor #00b2e2 | |
skinparam DefaultFontColor #454645 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
' defaults | |
' skinparam monochrome true | |
skinparam roundcorner 20 | |
skinparam shadowing false | |
skinparam DefaultFontName Proxima Nova | |
skinparam ArrowColor #00b2e2 | |
skinparam DefaultFontColor #454645 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'mysql2' | |
gem 'rails', '5.1.6' | |
gem 'dalli' | |
gem 'dig_bang' | |
gem 'jquery-rails' | |
gem 'kaminari' | |
gem 'law_string', github: 'public-law/law_string' | |
gem 'memery' | |
gem 'naturally' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cask_args appdir: "/Applications" | |
tap "codeclimate/formulae" | |
tap "homebrew/completions" | |
tap "homebrew/core" | |
tap "homebrew/bundle" | |
tap "homebrew/services" | |
tap "caskroom/fonts" | |
tap "caskroom/versions" | |
tap "caskroom/cask" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## rewrite spider | |
if ($http_user_agent ~* (baiduspider|googlebot|Googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot)) { | |
rewrite ^/(.*)$ https://www.baidu.com permanent; | |
} | |
## rewrite mobile | |
location /{ | |
set $mob 'y'; | |
if ($http_user_agent ~* "(Android|iPhone|Windows Phone)"){ set $mob "${mob}e"; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DIR=$1 # 转换编码文件目录 | |
FT=$2 # 需要转换的文件类型(扩展名) | |
SE=$3 # 原始编码 | |
DE=$4 # 目标编码 | |
for file in `find $DIR -type f -name *.$FT`; do | |
echo "conversion $file encoding $SE to $DE" | |
iconv -f $SE -t $DE "$file" > "$file".tmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImagesController < ApplicationController | |
before_action :load_parent_resource | |
include RestfulResources | |
restful_resources resource_name: :image | |
private | |
def load_resources | |
@images = resource_scope.all.group_by(&:kind) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.conj.io/store/v1/org.clojure/clojure/1.8.0/clj/clojure.core/get-in | |
module CoreExtensions | |
module GetIN | |
def get_in(enum, default = nil) | |
enum.inject(self) do |mem, var| | |
case var | |
when Fixnum then mem = mem.at(var) | |
when Symbol, String then mem = mem.fetch(var, default) | |
end | |
mem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 检测浏览器的 User Agent 应该是非常简单的事情 | |
// 微信在 Android 下的 User Agent | |
mozilla/5.0 (linux; u; android 4.1.2; zh-cn; mi-one plus build/jzo54k) applewebkit/534.30 (khtml, like gecko) version/4.0 mobile safari/534.30 micromessenger/5.0.1.352 | |
// 微信在 iPhone 下的 User Agent | |
mozilla/5.0 (iphone; cpu iphone os 5_1_1 like mac os x) applewebkit/534.46 (khtml, like gecko) mobile/9b206 micromessenger/5.0 | |
// 通过javascript判断 | |
// 很容易看出来,微信的 User Agent 都有‘micromessenger’字符串标示,我们判断是否含有这些字符串就OK了 | |
function isWeixinBrowser(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
NewerOlder