This file contains hidden or 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
| bundle install --path vendor/bundle | |
| gem install rails -v 版本号 |
This file contains hidden or 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
| #encoding: utf-8 | |
| require "fileutils" | |
| namespace :my_db do desc "Backup project database. Options: DIR=backups RAILS_ENV=production MAX=7" | |
| desc "usage - bundle exec rake my_db:backup RAILS_ENV=production MAX=15 DIR=db/db.bak" | |
| task :backup => [:environment] do | |
| # config base dir | |
| datestamp = Time.now.strftime("%Y%m%d%H%M") | |
| base_path = Rails.root | |
| backup_folder = File.join(base_path, ENV["DIR"] || "backups") | |
| FileUtils.mkdir_p(backup_folder) unless File.exist?(backup_folder) |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| ## | |
| ############################################################################## | |
| ## | |
| ## Script convert wav to mp3 for UN*X | |
| ## | |
| ## Dependence: | |
| ## - [ffmpeg](https://ffmpeg.org/) | |
| ## | |
| ## Script File: |
This file contains hidden or 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
| # encoding: utf-8 | |
| # | |
| # - [HTTP协议及签名](https://help.aliyun.com/document_detail/56189.html) | |
| # - [OpenSSL::HMAC](https://ruby-doc.org/stdlib-2.1.0/libdoc/openssl/rdoc/OpenSSL/HMAC.html) | |
| # | |
| require 'uri' | |
| require 'cgi' | |
| require 'base64' | |
| require 'openssl' | |
| require 'httparty' |
This file contains hidden or 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
| # encoding: utf-8 | |
| # | |
| # - [HTTP协议及签名](https://help.aliyun.com/document_detail/56189.html) | |
| # - [OpenSSL::HMAC](https://ruby-doc.org/stdlib-2.1.0/libdoc/openssl/rdoc/OpenSSL/HMAC.html) | |
| # | |
| require 'uri' | |
| require 'cgi' | |
| require 'base64' | |
| require 'openssl' | |
| require 'httparty' |
This file contains hidden or 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
| #!/bin/bash | |
| # | |
| ## redis backup script | |
| ## usage | |
| ## redis-backup.sh port backup.dir | |
| port=${1:-6379} | |
| backup_dir=${2:-"/data/backup/redis"} | |
| cli="/usr/local/bin/redis-cli -p $port" |
This file contains hidden or 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
| Sub ExcelPrint | |
| Call exportToExcel_ALL() | |
| End Sub | |
| Public Function exportToExcel_ALL() | |
| Dim aryExport(14,3) | |
| aryExport(0,0) = "CH57" | |
| aryExport(0,1) = "直营业绩周报表" | |
| aryExport(0,2) = "A1" | |
| aryExport(0,3) = "data" |
This file contains hidden or 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
| <!-- | |
| 监视input输入为手机号 | |
| 即输入内容为11位数字 | |
| --> | |
| <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script> | |
| <input type="text" id="number"> | |
| <script> | |
| function chk_phone_number(input) { | |
| if(input.val().toString().match(/^[-]?[0-9]+[\.]?[0-9]*$/)==null || |
This file contains hidden or 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
| ctrl+a 跳到行首 | |
| ctrl+e 跳到末尾 | |
| ctrl+d 删除光标后1个字符 | |
| ctrl+h 删除光标前1个字符 | |
| ctrl+u 清除至行首 | |
| ctrl+k 清除至行尾 | |
| ctrl+f 光标后移1个字符 |
This file contains hidden or 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
| <div id="picture_show" style="position: absolute; display: none; background: none repeat scroll 0% 0% rgb(211, 211, 211); border-radius: 5px;z-index: 10000; "> | |
| <img> | |
| </div> | |
| //picture show orginal size | |
| $("#picture_list img").each(function(){ | |
| $img = $(this); | |
| $tooltip = $("#picture_show"); | |
| $img.hover( |
NewerOlder