This file contains 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
controllers = Dir.new("#{Rails.root}/app/controllers/admin").entries | |
controllers.each do |controller| | |
if controller =~ /_controller/ | |
cont = controller.camelize.gsub(".rb","") | |
cont1 = controller.gsub("_controller.rb", "") | |
(eval("Admin::#{cont}.action_methods")).sort.each {|met| | |
puts "admin/#{cont1}##{met}" | |
} | |
end | |
end |
This file contains 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
unless Rails.env.production? | |
connection = ActiveRecord::Base.connection | |
connection.tables.each do |table| | |
connection.execute("TRUNCATE #{table}") unless table == "schema_migrations" | |
end | |
sql = File.read('db/import.sql') | |
statements = sql.split(/;$/) | |
statements.pop |
This file contains 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
江西经济发展研究院 | |
研究生学院 | |
校办公室 | |
国际学院 | |
档案馆 | |
信息管理学院 | |
资产管理处 | |
外国语学院 | |
马克思主义学院 | |
老干处 |
This file contains 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 'mechanize' | |
a = Mechanize.new | |
File.open('links.txt', 'w') do |file| | |
a.get('http://kuai.xunlei.com/d/z51zDAKLFgAjwMdT993') do |page| | |
links = page.links_with(class: 'file_name') | |
links.each do |l| | |
file.write(l.href + "\n") | |
end | |
end |
bundle exec guard -P livereload
This file contains 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 recursiveDelDirecoty( $dir, $delMe = FALSE ) { | |
$dir = realpath( $dir ); | |
try{ | |
$it = new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir, RecursiveDirectoryIterator::SKIP_DOTS ), RecursiveIteratorIterator::CHILD_FIRST ); | |
foreach( $it as $i ) { | |
if ( $i->isDir() ) { | |
rmdir( $i->getRealPath() ); | |
echo "删除". $i . "目录成功"; | |
}else{ | |
unlink( $i->getRealPath() ); |
This guide assumes you have the emmet
and language-babel
packages already installed in Atom
- Open the
keymap.cson
file by clicking onAtom -> Keymap…
in the menu bar - Add these lines of code to your keymap:
'atom-text-editor[data-grammar~="jsx"]:not([mini])':
This file contains 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 'mina/git' | |
require 'mina/nginx' | |
set :application, 'your_app_name' | |
set :domain, 'your_server' | |
set :user, 'ubuntu' | |
set :deploy_to, '/location/to/deploy' | |
set :app_path, "#{deploy_to}/#{current_path}" | |
set :repository, 'your_repo' | |
set :branch, 'master' |