Skip to content

Instantly share code, notes, and snippets.

toretore / donkey
Created July 20, 2008 20:32
donkeys are awesome
toretore /
Last active December 11, 2023 06:47
MySQL character sets and collations

Understanding, working with and properly configuring character sets and collations in MySQL

Read: How to actually, really use proper UTF-8 for everything

MySQL understands and uses character sets and collations when receiving, storing and sending data. In previous versions the default character set and collation were latin1 and latin1_swedish_ci, but as of version 8.0 these defaults have been changed to the much more sane utf8mb4 and utf8mb4_0900_ci_ai. It's a good time to go through exactly how these concepts work in MySQL and to make sure we're using the correct values everywhere.

This document assumes MySQL version 8.0 unless otherwise specified.

Keybase proof

I hereby claim:

  • I am toretore on github.
  • I am toretore ( on keybase.
  • I have a public key whose fingerprint is 0D82 2905 B532 A80A CE49 E210 43B5 0AA1 B582 BDA7

To claim this, I am signing this object:

toretore / README
Created May 4, 2011 08:08
Rails authentication
User authentication with Rails
This is all you need to have fully working and secure authentication in Rails.
Why use this instead of <bloated auth framework>? Well, there are a number of
reasons, but I guess you'll just have to go through a few apps where you
learn the hard way why the idea of a "fully featured" authentication
framework that doesn't get on your nerves is a mirage.
Don't simply copy and paste this without understanding everything it does. It's
-- The `msg` in `Html msg` and `Cmd msg` can be anything
-- Most Elm apps will have a `Msg` type at the top lever describing the messages
-- that can be processed by `update`:
type Msg
= UserLoaded (Maybe User)
| UserSelected User
module Location
type Location
= None
| SelectCountry (List Country)
| CountrySelected Country
| SelectRegion Country (List Region)
| RegionSelected Country Region
| SelectCity Country Region (List City)
| Complete Country Region City
module Customers exposing (Error, Customers, init, toLoading, toFailure, toSuccess)
type alias Error = String
type Customers
= NotAsked
| Loading (Maybe Error) (Maybe (List Customer))
| Failure Error (Maybe (List Customer))
| Success (List Customer)
require 'logger'
require 'fileutils'
require 'time'
require 'fiber'
module Logging
class Logger
toretore / lb.rb
Last active September 26, 2016 20:55
require 'thread'
state = {time:, status: "Flux Capacitor running"}
messages =
class TimeChange
attr_reader :time
def initialize(t)
@time = t