Skip to content

Instantly share code, notes, and snippets.

View tdd's full-sized avatar

Christophe Porteneuve tdd

View GitHub Profile
@tdd
tdd / git-bash-prompt.bash
Created July 16, 2015 09:54
Bash prompt configuration for Git’s built-in prompt features
# 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 / angular-just-say-no.md
Last active November 18, 2022 20:47
Angular: Just Say No

Angular: Just say no

A collection of articles by AngularJS veterans, sometimes even core committers, that explain in detail what's wrong with Angular 1.x, how Angular 2 isn't the future, and why you should avoid the entire thing at all costs unless you want to spend the next few years in hell.

Reason for this: I'm getting tired of having to explain to everyone, chief of which all the indiscriminate Google Kool-Aid™ drinkers, why I have never believed in Angular, why I think it'll publicly fail pretty soon now (a couple years), and why it's a dead end IMO. This gist serves as a quick target I can point people to in order not to have to parrot / compile the core of the articles below everytime. Their compounded reading pretty much captures 99% of my view on the topic.

This page is accessible through http://bit.ly/angular-just-say-no and http://bit.ly/angularjustsayno, btw.

@tdd
tdd / INTRO.md
Last active August 29, 2015 14:15
My roadmap for NodeSchool workshops
@tdd
tdd / partial.js
Created February 3, 2015 13:55
Partial application
function add(a, b, c) {
return a + b + c;
}
function partial(fx) {
var initial = Array.prototype.slice.call(arguments, 1);
return function() {
var args = Array.prototype.slice.call(arguments);
return fx.apply(this, initial.concat(args));
};
@tdd
tdd / .jshintrc.js
Last active August 29, 2015 14:13
Ma config JSHint par défaut
// Configuration globale au projet de JSHint
// =========================================
//
// (Y compris celui intégré à votre EDI/éditeur, normalement)
//
// [Liste complète des options possibles](http://www.jshint.com/docs/options/)
{
// Options de restriction
// ----------------------
@tdd
tdd / splice.js
Last active November 17, 2015 10:04
splice exo
var items;
// insertAt //////////////////////////////////
function insertAt(arr, pos, item) {
}
items = ['one', 'two', 'three'];
console.assert(insertAt(items, 1, 'yo') === 4);
@tdd
tdd / findOrCreateByAuth.js
Created December 4, 2014 16:59
findOrCreateByAuth
userSchema.statics.findOrCreateByAuth = function findOrCreateByAuth(id, name, provider, done) {
var User = this;
User.update(
{ _id: id, provider: provider },
{ name: name, provider: provider },
{ upsert: true },
function(err, numAffected, details) {
if (err) {
return done(err);
}
@tdd
tdd / web-learning-and-watchind.md
Last active December 9, 2015 13:46
Quelques ressources pour faire sa veille technique et apprendre mieux autour du web

Lisez plutôt…

cet article détaillé que j'ai écrit ensuite…

Je laisse le Gist ici pour ne pas casser vos liens, mais bon 😄

Par e-mailing/RSS/etc.

Chaque jour ou chaque semaine :

@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:

@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\]'