|
|\_ app
|...
|\_ docker
| |
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
| require 'redis' | |
| redis_connection = Redis.new(url: "redis://localhost:6379/0") | |
| redis_connection.subscribe("messages") do |on| | |
| on.message do |channel, msg| | |
| puts "##{channel} - [#{msg}]" | |
| end | |
| end |
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
| require 'socket' | |
| host = 'localhost' # web服务器 | |
| port = 80 # 默认 HTTP 端口 | |
| path = "/data.json" # 想要获取的文件地址 | |
| # 这是个 HTTP 请求 | |
| request = "GET #{path} HTTP/1.0\r\n\r\n" | |
| socket = TCPSocket.open(host,port) # 连接服务器 |
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
| server { | |
| listen 80; | |
| server_name xxx; | |
| location / { | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Forwarded-Host $host; | |
| proxy_set_header X-Forwarded-Server $host; | |
| proxy_set_header X-Real-IP $remote_addr; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_buffering on; |
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
| set nocompatible | |
| filetype on | |
| syntax on | |
| set re=1 | |
| set ttyfast | |
| set lazyredraw | |
| " 设置主题 | |
| colorscheme molokai |
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
| 查看物理cpu个数 | |
| cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l | |
| 查看核心数量 | |
| grep 'core id' /proc/cpuinfo | sort -u | wc -l | |
| cat /proc/cpuinfo | grep "cpu cores" | wc -l |
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
| Exception | |
| NoMemoryError | |
| ScriptError | |
| LoadError | |
| NotImplementedError | |
| SyntaxError | |
| SignalException | |
| Interrupt | |
| StandardError | |
| ArgumentError |
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
| brew cask install java8 | |
| JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home | |
| PATH=$PATH:$JAVA_HOME/bin | |
| CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar | |
| export JAVA_HOME PATH CLASSPATH |
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
| function! Hello() | |
| ruby <<EOS | |
| p "hello world" | |
| EOS | |
| endfunction | |
| command! Test :call Hello() |
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
| module EggConcern | |
| def append_features base | |
| super | |
| base.instance_eval(&@_class_methods) | |
| base.class_eval(&@_class_eval) | |
| end | |
| def included base = nil, &block | |
| super | |
| @_class_eval = block |
NewerOlder