Search result of: ty so
Total 30 records
source /root/.bashrc # 这个是我的VPS上系统的原因 wget http://nginx.org/keys/nginx_signing.key sudo apt-key add nginx_signing.key # NGINX官方的要求 vim /etc/apt/sources.list # 偷偷安装了VIM,不为别的,好像比VI好用 # 在Sources文件后面加入如下两行: # `deb http://nginx.org/packages/ubuntu/ precise nginx # `deb-src http://nginx.org/packages/ubuntu/ precise nginx # 具体可以参考:http://nginx.org/en/download.html
在小程序开发就是带着脚镣跳舞。 平时用习惯了 activestorage, 今日想在小程序上上传照片也接入 active storage, 发现还是有一些有意思。 之所以使用 direct upload 原因很简单: 不花服务器带宽,增加体验。那么传统的 direct
somelib/file2") 于是在库中也可以定义普通的类和模块。顶层的常量作用域和文件并没有多大关联,而是平坦的,于是从一开始就可以获取在其他文件中定义的类。如果想要用命名空间来区分类的名字,可以用下面的方法来显式嵌入模块。 # net 库的例子来使用模块命名空间来区分类 module Net class SMTP # ... end class POP # ... end class HTTP # ... end end ### 就类的话题继续深入 #### 还是关于常量 到目前为止用文件系统的例子来类比了常量的作用域。现在请你完全忘掉刚才的例子。 常量里面还有各种各样的陷阱。首先,我们可以获取"外层"类的常量。 Const = "ok" class
source database, and MySQL 先看第一点设置选项尾 innodb_change_buffering,它能够针对三种类型的操作 INSERT、DELETE-MARK 、DELETE 进行缓存,三者对应 dml 语句关系如下: INSERT 操作:插入二级索引。 先进行 DELETE-MARK 操作,再进行 INSERT 操作:更新二级索引。 DELETE-MARK 操作:删除二级索引 // 代码路径:storage/innobase/include/ibuf0ibuf.h /* Possible
solution for the distributed enterprise platforms of today. shipcat - A standardisation tool and security layer on top of kubernetes to config manage microservices quiche - quiche is an implementation of the QUIC transport protocol and HTTP/3
sorted sets。其中 List 是一个链表,可以非常方便操作在首尾部插入/删除元素。 LPUSH: 在list 的左边插入一个元素。 LPOP: 在list的左边删除一个元素。 RPUSH: 在list的右边插入一个元素。 RPOP: 在list的右边删除一个元素。 LRANGE: 获取 list 一个范围内的元素, e.g. 'LRANGE key 0 99' 命令可以获取第1-100个元素。 1.1 如何使用 Redis 保存 feed 中的内容呢? Ryan
我用的 nginx+unicorn 访问网站会出现 We're sorry, but something went wrong. 我看了一下 production.log Connecting to
Ruby 2.4 对哈希表引入了一些性能改进,这些变化是 Vladimir Makarov 2016 年初向 Ruby Hash 提交补丁时提出的 这篇文章简单介绍一下 Ruby 哈希表的基础和
source 外,我们希望能把安装包也追加到 assets 中方便用户直接下载。如果每次都手工上传,既容易出错,也非常耗时。这就比较适合 Action 来自动化这块的工作,而且,打包和上传都走 GitHub 内部网络,速度更快。 在安装包编译好后,通过 curl 命令直接调用 GitHub API,就能上传到 assets 中,具体脚本内容如下所示: curl --silent \ --request POST \ --url "$upload_url?name
Socket error messages Hash#shift much faster Queue, SizedQueue, and ConditionVariable performance improvements Timeout internal exception can’t be rescued Easier streaming responses with WEBrick Numeric#step Use IO _nonblock without raising exceptions IO ignores
something.jpg" if original_filename # end 方法,大家应该不陌生。就是自定义存入upload文件夹中的文件名称。比如在上传图片时,这样写 (参考大神的文章 http://huacnlee.com/blog/carrierwave-upload-store-file-name-config/) def filename if original_filename @name ||= Digest::MD5.hexdigest(current_path) "#{@name}.#{file.extension}" end 通过查看后台传的参数, Processing by UpdateFilesController#create as HTML
types (1.21) Using polyglot (0.3.3) Using treetop (1.4.12) Using mail (2.5.3) Using actionmailer (3.2.13) Using arel (3.0.2) Using tzinfo (0.3.37) Using activerecord (3.2.13) Using activeresource (3.2.13) Using rack-ssl (1.3.3) Using json (1.7.7) Using rdoc
Something else here', '#' %li.divider %li = link_to 'Another link', '#' 以下是我的 layout 里面的菜单,我想把 ul.dropdown 以下的内容写成下拉菜单,不太明白产生问题的原因,请指教。 body#rabel .navbar.navbar-inverse.navbar-static-top .navbar-inner .container a.btn.btn-navbar.collapsed( data-toggle='collapse' data-target='.nav-collapse') span.icon
type, :user set :rbenv_ruby, '2.1.1' set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec" set :rbenv_map_bins, %w{rake gem bundle ruby rails
Solidity,Go,Rust,C++ 等主流区块链系统开发语言至少一种,熟悉 Nodejs web3.js,ethers.js 库等。 【dapp 前端开发工程师】 职位描述: 1.负责 Dapp 智能合约应用的前端开发和维护; 2.与后端和链上进行交互,完成主要的业务逻辑; 3.项目官网的前端开发和维护; 4.Web 端,移动端的 UI 适配和交互实现。 5.具备前端系统架构能力,兼顾工程质量和开发效率。 任职要求: 1.3 年以上前端开发经验
source 'https://rubygems.org' gem 'Shuriken', path: '~code/Shuriken' gem 之后的 path 本地 gem 路径 由于还在开发阶段 所以暂不上传到你的 git ruby gems 网站 然后执行 bundle > cd shuriken-demo > bundle 学过 java 的同学都知道。java servelt , 那么 ruby 有什么呢
source_location) # action内的每个#号开头的注释,required optional开头的代码行都会写入文档,你可以写任何东西 detail = method_location.split("").map { |x| x[/^\s+(#.*)|(required.*)|(optional.*)/] }.compact.join("") doc_logger.info <<~HTML h1. #{I18n.t(@controller.action_name, scope: 'action_name', locale: 'zh-CN')}-#{@controller.action_name} 请求: #{method.upcase} #{@request.path
something attr_reader :one, :two, :three ``` * 考虑使用 `Struct.new`, 它可以定义一些琐碎的 `accessors`, `constructor`(构造函数) `comparison`(比较) 操作。 ```Ruby # good class Person attr_reader :first_name, :last_name def initialize(first_name, last_name) @first_name = first
我的是 macbook pro2017 款的,版本 10.14.3 项目比较老,用的 rails3.2,我本地安装的 rvm 都是 2.4+的,我先用
Type.register "text/vnd.turbo-stream.html", :turbo_stream end end end # app/controllers/messages_controller.rb class MessagesController < ApplicationController before_action :set_room, only: %i[ new create ] def create @message = @room.messages.create!(message_params) respond_to do |format| format.turbo_stream # 自动找 messages/create.turbo_stream.erb format.html { redirect
development.rb 中: config.action_mailer.smtp_settings = { :address => "smtpcloud.sohu.com", :port => 25, :authentication => :login, :domain => "我的发信域名", :user_name => "我的api
type, the most specific reference has precedence. RFC 里的例子: Accept: text/*, text/plain, text/plain;format=flowed, */* 这个 Accept 头里,类型优先级如下: text/plain;format=flowed text/plain text/* / 关于 Accept 优先级到此为止,不继续深究,有兴趣的同学可以阅读 RFC 原文。 遇到的问题 我们的项目采用前后端分离的写法,后端
下载了 shopqi 项目,走到执行 bundle install 走到 therubyracer 就失败了, 我是 lion 10.7.3 Bundler version 1.1.0
sort_by{|x| x.updated_at}.reverse! respond_to do |format| format.atom { render :layout => false } # we want the RSS feed to redirect permanently to the ATOM feed format.rss { redirect_to feed_path(:format => :atom), :status => :moved
type_cast(locking_column) # lock_version追加到更新字段中 attribute_names << locking_column # lock_version + 1 self[locking_column] += 1 # 执行更新操作,返回受影响行数 # 更新字段:attribute_names + lock_version # 查询条件:primary_key + lock_version affected_rows = self.class._update_record( attributes
部署 Rails添加新用户 在服务器添加一个新的用户,用户名为 deploy教程 执行命令adduser 按提示输入密码 设置一些个人信息,可以直接按 enter 键,设为空 添加权限 root
solution 繞過。現在 4 直接支援 update_columns ActionController before_filter 更名為 before_action:就是正名... respond_to do |format| 拿掉 xml json 取代:2013 年了,沒人再拿 xml default API... Security 拿掉 attr_accessible,改用