Skip to content

Instantly share code, notes, and snippets.

View tdd's full-sized avatar

Christophe Porteneuve tdd

View GitHub Profile
@tdd
tdd / gitconfig.ini
Last active April 17, 2024 10:04
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = your@email.tld
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
@tdd
tdd / config-bash-pour-un-prompt-git-de-tueur.bash
Last active April 17, 2024 10:04
Config Bash pour un prompt Git de tueur
# STEP 1: ENSURE COMPLETION AND PROMPT FUNCTION ARE LOADED
# ========================================================
# OPTION 1: If on OSX using Homebrew:
#
# source $(brew --prefix)/etc/bash_completion.d/git-prompt.sh
# source $(brew --prefix)/etc/bash_completion.d/git-completion.bash
# OPTION 2: If on OSX using built-in Git (also works on ZSH):
#
@tdd
tdd / backbone-localstorage-sync.js
Created January 30, 2013 13:47
Quick run-through of syncing a Backbone.Collection with a localStorage cache
// Assumes http://brian.io/lawnchair/ and http://backbonejs.org/
var collection = new MyCollection();
var localStore = new Lawnchair({ name: 'my-cache' }, $.noop);
// First load from the cache, then fetch
function initialLoad() {
localStore.all(function(items) {
collection.reset(items, function() {
collection.fetch();
@tdd
tdd / conf-best-practices.markdown
Last active March 23, 2020 18:03
A list of best-practices for conference organizers. Especially useful for first-time organizers, I guess.

Website

Things your website should clearly state / make accessible:

  • The core focus of your conf
  • Your core values
  • The (precise) location
  • The dates
  • Your programme, complete with speakers and their bios/pics
@tdd
tdd / throttle.js
Created June 6, 2013 16:38
Exo de programmation fonctionnelle à trous : Throttling
Function.prototype.throttle = function(/* … */) {
var f = this;
// …
return function() {
// …
return f.apply(this, arguments);
};
};
@tdd
tdd / e-marchand-pourrissime.md
Created July 15, 2013 19:47
En 2013, un site e-marchand pourrissime

Pour le LULZ ce soir, je teste le site marchand de la filiale FR d'une grande enseigne internationale. J'ai été tellement ébahi par le degré de fail que je me suis senti obligé de faire un compte-rendu, un tweet n'aurait pas rendu justice à un tel niveau de moisitude…

Ergonomie et mise en page

  • Le plus grand foutoir partout, avec une palme indétrônable pour tous les formulaires
  • Tous les Call-To-Action sont des textes sans mise en avant
  • Des fautes de frappe partout
  • En récap de commande (à consulter manuellement, affiché nulle part automatiquement après le paiement), les lignes de commande sont du texte brut au format "libellé quantité prix", tout collé. Tu as payé un produit "Toto" à 2,20€ ? Ça affiche en petit "Toto 1 2,20€", et donc tu lis "Toto 12,20€" et tu paniques :-)
  • Des tas de pavé de texte en Serif 10px…
"ensure_newline_at_eof_on_save": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
@tdd
tdd / Apprendre JS correctement.md
Last active January 26, 2024 17:48
Quelques ressources valables pour (ré)apprendre JS correctement
@tdd
tdd / gist:fb863904b337347cabde
Created June 19, 2014 08:49
Prompt PS1 Bash Git avec les couleurs
export PS1='\[\e[0;36m\][\A] \u@\h:\[\e[0m\e[0;32m\]\W\[\e[1;33m\]$(__git_ps1 " (%s)")\[\e[0;37m\] \$\[\e[0m\]'
@tdd
tdd / git-subtrees.md
Last active October 2, 2020 18:25
Subtrees investigations

Workbench

We extract our test repos from this small Zip file.

  • main is a "container" repository with its working copy,
  • plugin is a "shared" repository with its working copy,
  • remotes emulates remote bare repos for both, to better resemble regular usage.

The idea is to use plugin as a subtree of main in a vendor/plugins/demo path, and allow maintenance both ways: