mysqldump --no-tablespaces -h example.com -u username -p databasename > dump.sql --set-gtid-purged=OFF
Import it
mysql -h example.com -u username -p databasename < dump.sql
View all databases charset and collation:
SELECT SCHEMA_NAME 'database', default_character_set_name 'charset', DEFAULT_COLLATION_NAME 'collation' FROM information_schema.SCHEMATA;
View specified database charset and collation:
USE db_name;
SELECT @@character_set_database, @@collation_database;
commaSeparateNumber(event) { | |
let x, x1, x2; | |
let nStr = event.target.value + ''; | |
nStr = nStr.replace(/\D+/g, ''); | |
x = nStr.split( '.' ); | |
x1 = x[0]; | |
x2 = x.length > 1 ? '.' + x[1] : ''; | |
var rgx = /(\d+)(\d{3})/; | |
while ( rgx.test(x1) ) { | |
x1 = x1.replace( rgx, '$1' + ',' + '$2' ); |
<div class="parent"> | |
<section> | |
<h1>Center elements</h1> | |
<p>Center elements vertically or horizontally using following css</p> | |
<pre> | |
<code> | |
.parent { | |
display: flex; | |
justify-content: center; | |
align-items: center; |
# Source: https://github.community/t/cache-rails-assets-generated-by-webpacker/189057/4 | |
- name: Get Webpacker cache key | |
id: get-webpacker-cache-key | |
run: | | |
echo "::set-output name=key::$(bin/rails r 'print Webpacker::Instance.new.compiler.send(:watched_files_digest)')" | |
shell: bash | |
- name: Cache precompiled assets | |
uses: actions/cache@v3 | |
with: |
-- Plugin can be 'auth_socket', 'mysql_native_password' or 'caching_sha2_password' | |
SELECT user, authentication_string,plugin,host FROM mysql.user; | |
-- Change the auth socket plugin to mysql_native_password of root user | |
ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password'; | |
FLUSH PRIVILEGES; | |
-- Create another user that uses caching_sha2_password as plugin | |
USE mysql; | |
CREATE USER '{user}'@'localhost' IDENTIFIED WITH caching_sha2_password BY '{password}'; |
devise_for :users, :skip => [:registrations] | |
as :user do | |
get 'users/edit' => 'devise/registrations#edit', :as => 'edit_user_registration' | |
put 'users' => 'devise/registrations#update', :as => 'user_registration' | |
end | |
# And then modify the app/views/devise/shared/_links.erb |