Install Devise
#out of article scope
Generate Devise Views
rails g devise:views
Add file to config/locale/devise.en.yml
require 'rubygems' | |
require 'rbvmomi' | |
require 'pp' | |
require 'alchemist' | |
hyper = 'thunder03' | |
vim = RbVmomi::VIM.connect :host => hyper, :user => 'root', :password => 'secret', :insecure => true | |
# | |
# get current time |
# Convert Hashes to CSV easily | |
# source.rb | |
# | |
# { valid: "ruby", hash: "" } | |
# { another: "valid", ruby: "hash" } | |
# { etc... | |
# usage: | |
# |
def select_from_chosen(item_text, options) | |
field = find_field(options[:from]) | |
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()") | |
page.execute_script("$('##{field[:id]}').val('#{option_value}')") | |
end |
1.安装(CentOS 6.2) | |
$wget http://redis.googlecode.com/files/redis-2.x.xx.tar.gz | |
$tar zxf redis-2.x.xx.tar.gz | |
$cd redis-2.x.xx | |
$make | |
$make install | |
////// | |
mkdir -p /usr/local/bin | |
cp -pf redis-server /usr/local/bin |
# derived from http://railscasts.com/episodes/340-datatables | |
# handles server side multi-column searching and sorting | |
class Datatable | |
delegate :params, :h, :raw, :link_to, :number_to_currency, to: :@view | |
def initialize(klass,view) | |
@klass = klass | |
@view = view | |
end |
Install Devise
#out of article scope
Generate Devise Views
rails g devise:views
Add file to config/locale/devise.en.yml
#!/usr/local/bin/python | |
""" | |
To use this script, you must be in the root directory of a Rails project that | |
is using git. You should also make sure that your directory does not contain any | |
uncommitted changes. Then run: | |
$ python rails_switch_branch.py name_of_another_branch | |
Running the above will do the following: |
grep -r --color --exclude-dir={custom,lib,scripts} --exclude={*.xml,error_log} "beta" . |
########################################### | |
# IMPORTANT NOTE: | |
# | |
# As of asuswrt-merlin 380.67 Beta, you | |
# can now configure SSL certificates from | |
# the Webui, making these instructions | |
# unnecessary. | |
########################################### | |
# see the current limits | |
$ sysctl -a | grep maxproc | |
# increase it | |
$ sudo sysctl -w kern.maxproc=xxxx | |
$ sudo sysctl -w kern.maxprocperuid=xxx | |
# run at startup | |
$ sudo vim /etc/sysctl.conf |