Skip to content

Instantly share code, notes, and snippets.

@FabienPapet
FabienPapet / gist:d56e48396737e289f1931e7218264326
Created January 27, 2025 16:35
Move database from server to server
#!/bin/bash
#set -ex # Set debug mode
SOURCE_DB="source_db"
SOURCE_USER="source_user"
SOURCE_PASSWORD="source_password"
SOURCE_HOST="source_host"
TARGET_DB="target_db"
@FabienPapet
FabienPapet / rio.js
Created August 5, 2015 09:02
RIO control for french phones in Javascript
function validate_isRIO(fullRIO, telephone) {
// fullRIO is id+ctlKey
var id = fullRIO.substr(0,fullRIO.length -3);
var ctlKey = fullRIO.substr(fullRIO.length -3, 3);
var ordre = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+";
var a = b = c = 0;
var concat = id + telephone;
console.log(concat);
@FabienPapet
FabienPapet / gist:7c2b018e49657aa1e120
Created June 23, 2015 21:55
Create database with UTF8 encoding
CREATE DATABASE mydb DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;