This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($,sr){ | |
// debouncing function from John Hann | |
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ | |
var debounce = function (func, threshold, execAsap) { | |
var timeout; | |
return function debounced () { | |
var obj = this, args = arguments; | |
function delayed () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------- | |
# installing dnsmasq and enable daemon | |
# ---------------------- | |
brew install dnsmasq | |
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons | |
# ---------------------- | |
# adding resolver for local domain | |
# ---------------------- | |
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver | |
sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/local' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Writes sources.list in order to add non-free repository | |
# | |
DEBIAN_RELEASE=`cat /etc/*-release 2> /dev/null | grep PRETTY_NAME | awk -F "=" {'print $2'} | awk -F "(" {'print $2'} | awk -F ")" {'print $1'}` | |
echo "Writes /etc/apt/sources.list in order to add $DEBIAN_RELEASE non-free repository" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Permet de mettre à jour un dépot git local à partir d'un remote github | |
# Va chercher le sha du dernier commit distant et le compare au sha stocké | |
# suite au dernier lancement du script. Si le sha est différent, le | |
# script lance le git pull | |
# Si le script est bloqué, faut vider le fichier dans /tmp avant de relancer | |
OWNER="telabotanica" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
## Pour mettre à jour le thème wordpress (https://github.com/telabotanica/wp-theme-telabotanica/) | |
## | |
## Killian, 9 mars 2017 | |
dossier_env_test="/home/beta/www/test/wp-content/themes/telabotanica" | |
dossier_env_preprod="/home/beta/www/preprod/wp-content/themes/telabotanica" | |
fetch="git fetch origin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
width=1600 | |
height=1200 | |
for FILE in $( | |
find . -type f -exec file {} \; | | |
awk -F: '{if ($2 ~/image/) print $1}' | |
); | |
do | |
identify -format '%w %h %i\n' "$FILE" | | |
awk '$1 > $width || $2 > $height {sub(/^[^ ]* [^ ]* /, ""); print}' | |