a Ruby Gem for using aliyun sms service. 一个应用阿里云短信推送服务的Ruby Gem。 Aliyun::Sms 阿里云短信服务 Ruby Gem aliyun-sms 用于阿里云短信服务的 Ruby Gem. 使用这个 Gem 的前提是已经在阿里云注册用户,申请开通了短信服务, 并获得了以下几个关键参数: ACCESS_KEY_SECRET: 阿里云接入密钥,在阿里云控制台申请获取。 ACCESS_KEY_ID: 阿里云接入 ID, 在阿里云控制台申请获取。 SIGN_NAME: 短信签名,在阿里云申请开通短信服务时获取。 TEMPLATE_CODE: 短信模版代码,在阿里云申请开通短信服务时申请获取。 1. Installation 安装 Rails 应用安装方法 在应用的 Gemfile 文件中添加 Ruby Gems 安装源: gem ‘aliyun-sms’ # Ruby Gems 安装源 应用的根目录下运行:… Continue Reading Ruby Gem – VICTOR-LUO-F/aliyun-sms

git-redmine-commit git commit with redmine issue id. With this tool, you can do a git commit with a redmine issue id. The message of the commit is filled with the title of the issue automatically. With this tool, you can do a git commit with a redmine issue id. The… Continue Reading Ruby Gem – robin/git-redmine-commit or atyun/git-redmine-commit

The application allows a user to log in to either the main site (http://lvh.me:3000/) or a user site (http://myname.lvh.me:3000/). Logging in creates a user session. In its current form, the application maintains separate and independent user sessions for the main site and each subdomain. That’s because session data for each… Continue Reading Allow Rails Sessions To Be Shared Across Subdomains

Spreadsheet Architect is a library that allows you to create XLSX, ODS, or CSV spreadsheets easily from ActiveRecord relations, Plain Ruby classes, or predefined data. Key Features: Can generate headers & columns from ActiveRecord column_names or a Class/Model’s spreadsheet_columns method Dead simple custom spreadsheets with custom data Data Sources: ActiveRecord… Continue Reading Ruby Gem – westonganger/spreadsheet_architect is a library that allows you to create XLSX, ODS, or CSV spreadsheets super easily from ActiveRecord relations, plain Ruby objects, or tabular data

Go faster, off the Rails – Benchmarks for your whole Rails app. A series of things you can use to benchmark a Rails or Ruby app. https://github.com/schneems/derailed_benchmarks 1. Install Put this in your gemfile: gem ‘derailed_benchmarks’, group: :development Then run $ bundle install. While executing your commands you may need… Continue Reading Ruby Gem – schneems/derailed_benchmarks

1. 概念 /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行。并从/etc/profile.d目录的配置文件中搜集shell的设置。 ~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时,该文件仅仅执行一次。默认情况下,他设置一些环境变量,执行用户的.bashrc文件或.profile文件,具体以.bash_profile代码为准。 /etc/bashrc:为每一个运行bash shell的用户执行此文件。当bash shell被打开时,该文件被读取。 ~/.bashrc:该文件包含专用于你的bash shell的bash信息,当登录时以及每次打开新的shell时,该文件被读取。 ~/.bash_logout:当每次退出系统(退出bash shell)时,执行该文件。 另外,/etc/profile 中设定的变量(全局)的可以作用于任何用户,而 ~/.bashrc 等中设定的变量(局部)只能继承 /etc/profile 中的变量,他们是 父子 关系. ~/.bash_profile 是交互式、login 方式进入 bash 运行的 ~/.bashrc 是交互式 non-login 方式进入 bash 运行的 通常二者设置大致相同,所以通常前者会调用后者,或者前者会调用.profile,具体以.bash_profile代码为准。 2. 执行顺序 2.1 Linux执行顺序 在刚登录Linux时,首先启动 /etc/profile 文件,然后再启动用户目录下的 ~/.bash_profile、 ~/.bash_login 或 ~/.profile 文件中的其中一个(根据不同的linux操作系统的不同,命名不一样), 执行的顺序为:~/.bash_profile、 ~/.bash_login、 ~/.profile。 如果 ~/.bash_profile文件存在的话,一般还会执行 ~/.bashrc文件 因为在… Continue Reading .bash_profile,profile,bashrc的区别和启动顺序

Robo 3T(原名Robomongo)是一款跨平台的MongoDB图形化客户端数据库管理软件, 基于Shell。支持操作系统包括:Windows, Linux, 和Mac OS。可以管理数据库内容以及编辑数据库代码,内置一个代码编辑区域,可以将数据库文件放到软件上修改,结合图形化的处理方式,支持将MongoDB数据库中的文件转换为分布式的存储方式,提高数据文件编辑和保存效率,方便查找数据库对象、利用其中的数据生成器,可以将Excel文件的数据导入数据库中保存,方便制作数据文件。 https://robomongo.org/ 1. Robo 3T Robo 3T (formerly Robomongo) is the free lightweight GUI for MongoDB enthusiasts. MongoDB GUI with embedded shell 2. Studio 3T Are you serious about MongoDB? Choose Studio 3T – our fully featured IDE for MongoDB professionals. Fully featured IDE with… Continue Reading MongoDB数据库管理开源工具Robo 3

ruby-prof: a code profiler for MRI rubies https://github.com/ruby-prof/ruby-prof 1. Overview ruby-prof is a fast code profiler for MRI Ruby. Its features include: Speed – it is a C extension and therefore many times faster than the standard Ruby profiler. Modes – Ruby prof can measure a number of different parameters,… Continue Reading Ruby Gem – ruby-prof/ruby-prof

1. 问题描述 今天有一台服务器运行Rails项目遇到MySQL报错Character set ‘utf8mb4’ is not a compiled character set and is not specified in the ‘/usr/share/mysql/charsets/Index.xml’ file 详细异常如下: [[email protected] production]$ rails c :linux Character set ‘utf8mb4’ is not a compiled character set and is not specified in the ‘/usr/share/mysql/charsets/Index.xml’ file /home/blogbin/.rvm/gems/[email protected]/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `connect’: Can’t initialize character set utf8mb4 (path:… Continue Reading Rails项目遇到MySQL报错Character set ‘utf8mb4’ is not a compiled character set