Skip to content

Instantly share code, notes, and snippets.

View cvergne's full-sized avatar
👨‍💻
Probably developing…

Christophe VERGNE cvergne

👨‍💻
Probably developing…
View GitHub Profile
@cvergne
cvergne / stringUtils.js
Last active November 26, 2024 12:46
Little javascript method to get initials from a name
String.prototype.getInitials = function(glue){
if (typeof glue == "undefined") {
var glue = true;
}
var initials = this.replace(/[^a-zA-Z- ]/g, "").match(/\b\w/g);
if (glue) {
return initials.join('');
}

Keybase proof

I hereby claim:

  • I am cvergne on github.
  • I am cvergne (https://keybase.io/cvergne) on keybase.
  • I have a public key whose fingerprint is 10F7 C861 0001 6852 9C2A BA38 A535 5A6C F8E4 E1C0

To claim this, I am signing this object:

@cvergne
cvergne / migrate_env.sh
Created November 19, 2018 14:57
Symfony .env migration
#!/bin/bash
set -e # stop on error
set -x # print commands
# cf. https://symfony.com/blog/improvements-to-the-handling-of-env-files-for-all-symfony-versions
mv .env .env.local
mv .env.dist .env
sed -i '' 's/\.env/\.env\.*/g' .gitignore