Avant de se lancer, rien de tel que revoir le partitionnement, car après, c'est un peu plus dur.
$ passwd
Ouvrir une nouvelle fenêtre SSH et tester le nouveau mot de passe.
def bash_format(formats, text) | |
res = "\e[0" | |
colors = { :red =>";31", :yellow => ";33", :green => ";32" } | |
styles = { :bold => ";1", :underline => ";4" } | |
if formats.is_a?(Array) || formats.is_a?(Hash) | |
colors.each { |k,v| res += v if formats.include?(k) } | |
styles.each { |k,v| res += v if formats.include?(k) } | |
elsif formats.is_a?(Symbol) | |
colors.each { |k,v| res += v if formats == k } | |
styles.each { |k,v| res += v if formats == k } |
#!/usr/bin/env ruby | |
# | |
# A hook script to verify that only syntactically valid ruby code is commited. | |
# Called by git-commit with no arguments. The hook should | |
# exit with non-zero status after issuing an appropriate message if | |
# it wants to stop the commit. | |
# | |
# Put this code into a file called "pre-commit" inside your .git/hooks | |
# directory, and make sure it is executable ("chmod +x .git/hooks/pre-commit") | |
# |
J'ai un dégoût personnel pour les conférences le week-end. Pour moi, une conférence le week-end garanti que je vais "bosser" 12 jours d'affilée. | |
J'ai bien conscience que cette opinion n'est pas universelle. | |
Certaines personnes ont des difficultés pour "décrocher" pour aller à des conférences. Ces situations ont bien l'air d'une mécompréhension des responsabilités d'un développeur logiciel. Une partie de votre boulot (de développeur logiciel) est de rester à jour technologiquement. Ça signifie passer du temps de recherche durant votre journée. | |
(à peu près piqué directement à Ward sur le [déficit technique](http://c2.com/cgi/wiki?WardExplainsDebtMetaphor)) | |
Si vous passez toute votre journée à coder, sans jamais regarder du coté des nouvelles choses, vous accroissez votre déficit technique. À court terme (disons la dernière semaine avant une release), ça a du sens de prendre un peu de déficit. Par contre, à long terme, sans un minimum d'investissement, l'intérêt (où l'intérêt est égal à la distance entre vos |
#!/bin/sh | |
set -e | |
if [ ! "`id -u`" -eq 0 ]; then | |
echo "Must be root !" | |
exit 0 | |
fi | |
MYSQLUSER=root |
#! /bin/sh | |
SRC_DB_NAME='source db name' | |
SRC_DB_USER='source db user name' | |
SRC_DB_PWD='source db password' | |
DEST_DB_NAME='destination db name' | |
DEST_DB_USER='destination db user name' | |
DEST_DB_PWD='destination db password' | |
PARENT_DIR="/tmp" |
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
[04-08-2010 06h24] [Début Session Tchat] [Service choisi: Technique] | |
[06h24] Assistance: Mme/M. XXX, bienvenue sur le Tchat de Free, vous êtes actuellement connecté(e) sur le salon Technique. | |
Votre adresse email de contact: XXXXXX | |
Votre numéro de téléphone mobile de contact: XXXXXX | |
Notez que vous pouvez à tout moment modifier vos éléments de contact (mail + mobile) depuis votre interface de gestion, à la rubrique "Mon Abonnement". | |
[06h24] Moi: Bonjour | |
[06h24] Assistance: Bonjour, |
In my effort for porting the geokit-rails plugin to Rails 3, I've found that it would really benefit a full rewrite of the query composition parts.
My work can be followed here : http://github.com/jlecour/geokit-rails/ (make sure to look at the gem branch until it is merged into master) Any help is welcome.
The current version, compatible with Rails 2, has 2 main methods (find
and count
) and some utility methods, that are making some changes to the select/conditions/limit/order/… parts of the options hash passed to ActiveRecord and then call the super
related method on the model's class.
With ActiveRecord 3 and its scope approche, I think we don't need to mess with the hash anymore if we use the power of scopes. I would be cleaner, more chainable and reusable, …
That said, we have to consider the kind of additions Geokit makes to a typical query. As a brief summary, here is how it works.
def self.native_id_to_int(native_id) | |
alpha = "-ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" | |
res = "" | |
i = 0 | |
native_id.split(//).each do |c| | |
if ((i+=1) <= 4) && alpha.include?(c.to_s) | |
index = alpha.index(c) + 10 | |
res += index.to_s | |
else | |
res += c |