Skip to content

Instantly share code, notes, and snippets.

Avatar
🛌
overbooké

Killian STEFANINI kstefanini

🛌
overbooké
View GitHub Profile
@kstefanini
kstefanini / resize-image.sh
Created Feb 20, 2018
Crawl folders and resize images
View resize-image.sh
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}' |
View update_theme.sh
#!/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"
@kstefanini
kstefanini / pullauto.sh
Last active Feb 22, 2017
Cron-able script for auto pull
View pullauto.sh
#!/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"
@kstefanini
kstefanini / non-free.sh
Created Sep 24, 2014
Debian non-free script - Writes sources.list in order to add non-free repository
View non-free.sh
#!/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"
View enable_dnsmasq_on_osx.sh
# ----------------------
# 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'
View smartresize.js
(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 () {
You can’t perform that action at this time.