Skip to content

Instantly share code, notes, and snippets.

@gpaton
gpaton / private.xml
Last active May 24, 2023 17:33
Karabiner (KeyRemap4MacBook) remap "Play" OSX Key to launch Spotify
<?xml version="1.0"?>
<root>
<!-- Spotify Path -->
<vkopenurldef>
<name>KeyCode::VK_OPEN_URL_APP_Spotify</name>
<url type="file">/Applications/Spotify.app</url>
</vkopenurldef>
<!-- Set Spotify definition -->
<appdef>
@gpaton
gpaton / .bash_profile
Last active December 22, 2015 07:29
Modifie le prompt pour afficher le logo Apple à la place du nom de l'utilisateur.Affiche aussi la branche en cours si on est dans un repo git
# Auto-complétion Git
source ~/.git-completion.bash
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Alias
source ~/.alias
source ~/.bash_export
@gpaton
gpaton / encodeUrl
Created July 11, 2013 09:36
Encode les URLs en supprimant les mots de liaison
/**
* Encode name for URL
*
* @param string $p_sString
* @return string
*/
public function encode ($p_sString) {
$_sReturn = utf8_decode($p_sString);
$_sReturn = strtolower($_sReturn);
$_sReturn = strtr($_sReturn,