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 / 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

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 / stringUtils.js
Last active March 3, 2022 20:43
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('');
}
config_files = Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf")
config_files.each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).each_line do |line|
line.strip!
@cvergne
cvergne / itunes-play.sh
Created June 13, 2014 13:05
Avoid iTunes to launch when pressing "play" button
launchctl unload -w /System/Library/LaunchAgents/com.apple.rcd.plist
@cvergne
cvergne / dabblet.css
Created April 23, 2014 16:47
Untitled
body { padding:50px; background:#000; }
h1 { width:250px; font:bold 36px sans-serif; letter-spacing:-1px; color:#FFF; padding: 10px 0 10px 40px; }
.wrap {
box-shadow: -35px 0 0 5px #38bfdb, 10px 0 0 5px #38bfdb;
}
.inner {
background: #38bfdb;
position:relative;
}
@cvergne
cvergne / dabblet.css
Created April 23, 2014 16:47 — forked from anonymous/dabblet.css
Untitled
body { padding:50px; background:#000; }
h1 { width:250px; font:bold 36px sans-serif; letter-spacing:-1px; color:#FFF; padding: 10px 0 10px 40px; }
.wrap {
box-shadow: -35px 0 0 5px #38bfdb, 10px 0 0 5px #38bfdb;
}
.inner {
background: #38bfdb;
position:relative;
}
@cvergne
cvergne / fixairplay.sh
Created September 6, 2013 13:13
Restart audio process when selecting airplay receiver fails and auto select back Mac speakers.
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
@cvergne
cvergne / install_intl.sh
Created August 23, 2013 12:02
Install intl extension to MAMP
#!/bin/bash
# get php source code
mkdir /Applications/MAMP/bin/php/php5.4.10/include
cd /Applications/MAMP/bin/php/php5.4.10/include
wget -O php-5.4.10.tar.gz http://us.php.net/get/php-5.4.10.tar.gz/from/this/mirror
tar xzf php-5.4.10.tar.gz
@cvergne
cvergne / freebox.rss
Last active December 20, 2015 03:09
Format qu'un flux RSS doit avoir pour être pris en charge par le module RSS de Freebox OS.
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title>Downloads</title>
<link>http://www.example.com</link>
<description>List of auto-downloads</description>
<!-- <ttl>60</ttl> --> <!-- Durée (en minute) de mise en cache. Facultatif, mais empêche le raffrachissement manuel via l'API -->
<item>
<title>
Nom du téléchargement
</title>