Skip to content

Instantly share code, notes, and snippets.

View ssaunier's full-sized avatar

Sébastien Saunier ssaunier

View GitHub Profile
@fourseven
fourseven / retina-sprites.css.scss
Created August 16, 2012 09:19
A compass function to handle spriting with normal and retina images automatically.
// @Mixin Retina Sprite Sass
// ======================================================
// This requires two folders full of *.png files, normal and then
// 2x resolution. Please ensure that they have the same number and names
// of files.
// I've written this based off other efforts on the web, but none did
// both background-images and a set of sprites automatically.
// Still very much a work in progress.
// To use see the bottom three lines.
@darren131
darren131 / gist:3410875
Created August 21, 2012 02:30
resize sprites in Compass
@mixin resize-sprite($map, $sprite, $percent) {
$spritePath: sprite-path($map);
$spriteWidth: image-width($spritePath);
$spriteHeight: image-height($spritePath);
$width: image-width(sprite-file($map, $sprite));
$height: image-height(sprite-file($map, $sprite));
@include background-size(ceil($spriteWidth * ($percent/100)) ceil($spriteHeight * ($percent/100)));
width: ceil($width*($percent/100));
height: ceil($height*($percent/100));
anonymous
anonymous / imagemagick_brew.sh
Created December 19, 2012 11:49
How to downgrade imagemagick with brew if you have issues with rmagick gem
brew uninstall imagemagick
cd /usr/local/Cellar
git checkout 834ce4a /usr/local/Library/Formula/imagemagick.rb
brew install imagemagick
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
@nicolasblanco
nicolasblanco / gist:5684809
Last active December 17, 2015 22:49
The gems I use on almost all my projects (because today is Friday... if you know what I mean)

The gems I use on almost all my projects (because today is Friday... if you know what I mean)

  • kaminari

    Great pagination gem. I like writing my custom paginators as partials instead of Ruby classes.

  • rails_config

Even if there's "rails" in the name, this gem also works with other frameworks. Essential to have a global configuration object available everywhere in your app. I like the fact that it is environment-aware.

@thbar
thbar / proby
Last active December 18, 2015 01:38 — forked from jwood/proby
#!/bin/bash
#
# This script surrounds the command passed in with start and finish notifications
# to the Proby task monitoring application.
#
# Note thbar: this version is modified to properly handle errors when they happen,
# since the original version always returned a success.
#
# === SETUP
#
@ssaunier
ssaunier / Gemfile
Last active December 24, 2015 21:19
Prevent stubbing nonexistant method with rspec-fire and rspec-mocks. Discussed at http://sebastien.saunier.me/blog/2013/10/06/on-testing.html
source 'https://rubygems.org'
ruby "2.0.0"
gem "rspec"
gem "rspec-mocks"
gem "rspec-fire"
École du tech lead: Conversation autour de la dette technique
----
TLDR de Cyrille Deruel @CyrilleDeruel
Les 3 phrases sur la dettes
- Pas dépuration de la dette sans refactoring et pas de refactoring sans tests automatisés
- Normalement tu n'as pas besoin d'aller chercher la dette, c'est la dette qui te trouve
- Ta dette tu la gères tous les jours
@lukehefson
lukehefson / uninstall-GHfM.sh
Created November 27, 2013 13:48
Completely uninstall GitHub for Mac
#!/bin/bash
function remove_dir () {
rm -rf "$1_"
if [ -d "$1" ]
then
mv "$1" "$1_"
fi
}
@pcreux
pcreux / Gemfile
Last active December 11, 2023 20:24
Fast Rails + Heroku Configuration
group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end