Skip to content

Instantly share code, notes, and snippets.

View Nek-'s full-sized avatar
:octocat:

Maxime Veber Nek-

:octocat:
View GitHub Profile
@Nek-
Nek- / gist:2639467
Created May 8, 2012 21:28
probable fix doctrine utf-8 columns (but fails)
dbal:
default_connection: default
connections:
default:
charset: utf8
CREATE TABLE IF NOT EXISTS `address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`street` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`postcode` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
<?php
/**
* Classe totalement inutile
*/
class Useless
{
/**
* Fait une multiplication toute conne
*
CREATE TABLE `Article` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`title` varchar(255) NOT NULL,
`subTitle` varchar(255) DEFAULT NULL,
`content` longtext NOT NULL,
`slug` varchar(255) NOT NULL,
`lang` varchar(10) NOT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime DEFAULT NULL,
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
# Trying to fix charset
default-character-set=utf8
default-collation=utf8_unicode_ci
character_set_server=utf8
collation_server=utf8_unicode_ci
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
mysql> show variables like 'character_set_%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
Gem files will remain installed in /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11 for inspection.
Results logged to /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/mysql2-0.3.11/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.11'` succeeds before bundling.
@Nek-
Nek- / config_dev.yml
Created May 25, 2012 08:28
Sending mail with gmail in develop mode
swiftmailer:
transport: gmail
username: my_gmail_address@gmail.com
password: my_super_pass
@Nek-
Nek- / similar_search.sql
Created July 13, 2012 14:31
Search for similar elements
---- Récupération de 5 nodes similaires à une node ayant les tags suivants:
-- machin, machin2, machin3
/*
+---------------+ +------------------+ +------------------+
| Node | | Tagging | | Tag |
+---------------+ +------------------+ +------------------+
| id | < - - | resource_id | --------->| id |
| contenu | | ressource_type | / | name |
+---------------+ | tag_id |/ +------------------+
+------------------+