• 难招是钱没给到位。

  • WebSocket 方案选择 at 2019年05月10日
    # Gemfile
    gem "anycable-rails", "~> 0.6.2"
    gem "google-protobuf", "~> 3.7"
    gem "jwt", "~> 2.1"
    
    # Procfile
    bundle exec anycable --server-command="anycable-go --headers=Upgrade,Host,Referer,User-Agent,X-Forwarded-For,X-Real-IP,X-Request-Id,Remote_addr,Origin,Connection,Authorization,Sec-WebSocket-Protocol,Sec-WebSocket-Key,Sec-WebSocket-Accept --host=localhost --port 3334"
    
    <script src="https://cdn.jsdelivr.net/npm/actioncable@5.2.2/lib/assets/compiled/action_cable.min.js"></script>
    <script type="application/javascript">
      (function() {
        this.App || (this.App = {});
        App.initialize = (async () => {
          const accessToken = await getToken();
    
          ActionCable.INTERNAL.protocols.push(accessToken.auth.access_token);
    
          return ActionCable.createConsumer("ws://localhost:3334/cable");
        })();
      }).call(this);
      });
    </script>
    
    token =  request.headers["HTTP_SEC_WEBSOCKET_KEY"].to_s.split(", ").last
    
  • 牛逼!

    50 ~ 80 万年薪,Java 领域常见,再看看我们招聘板块,35 万顶天啦~(≧▽≦)/~啦啦啦

  • 配置文件有可能热更新么 at 2019年03月18日
    # frozen_string_literal: true
    
    # Redis > .env > default
    # FeatureToggle.fetch('ROLE_MAPPING') { { "read" => ["list", "read"], "list" => ["list", "read", "write"] } }
    # FeatureToggle.fetch('WHITELIST') { ["23","33","43","53"] }
    # FeatureToggle.fetch('HACK_ENABLE') { false }
    module FeatureToggle
      class << self
        def fetch(key)
          return read(key) if exists?(key)
    
          load ENV.fetch(key.upcase) { block_given? ? yield : nil }
        end
    
        def read(key)
          data = client.get(key.upcase)
          data = ENV.fetch(key.upcase) { block_given? ? yield : nil } if data.nil?
          load data
        end
    
        def write(key)
          return nil unless block_given?
    
          data = yield
          body = data.is_a?(String) ? data : Oj.dump(data)
          client.set(key.upcase, body)
          data
        end
    
        def delete(key)
          if exists?(key)
            data = read(key)
            client.del(key.upcase)
            data
          end
        end
    
        def keys
          client.keys
        end
    
        private
    
          def load(data)
            return Oj.load(data) if json?(data)
            return data.to_b if bool?(data)
    
            data
          end
    
          def exists?(key)
            client.exists(key.upcase)
          end
    
          def json?(data)
            data =~ %r(^(\{|\[)(.*)(\]|\})$)
          end
    
          def bool?(data)
            data =~ %r((true|false|yes|no|on|off))i
          end
    
          def client
            @client ||= Redis::Namespace.new(NAMESPACE, redis: Redis.current)
          end
    
          # redis key
          NAMESPACE = [Rails.application.class.parent_name.underscore, Rails.env, "FeatureToggle"].join(":").freeze
      end
    end
    
  • tus-ruby-server

  • app/models/concerns/soft_delete.rb
    
  • 这个人?他可是 sidekiq 的作者 😹

  • 场地里不提供WiFi😭

  • shrine + tus + minio

-- 征婚    
SELECT * FROM 男人    
WHERE 存款 > 1000000 AND 未婚 = 1
AND 同性恋 = 0 AND 贷款 = 0
AND 有房 = 1 AND 有车 = 1
AND 条件 IN('细心', '温柔', '体贴', '会做家务', '会做饭', '会逛街买东西', '会浪漫', '活泼', '可爱', '帅气', '绅士', '大度', '气质', '智慧', '最好还能带孩子')    
AND 年龄 BETWEEN(26, 40) ORDER BY 存款 DESC

❨╯°□°❩╯︵┻━┻