Skip to content

Instantly share code, notes, and snippets.

View sunny's full-sized avatar

Sunny Ripert sunny

View GitHub Profile
@sunny
sunny / gist:1118454
Created August 1, 2011 16:25
Mini console log that doesn't break in browsers without a console
# Mini console log that doesn't break in browsers without a console
log = ->
console?.log?(arguments...)
@sunny
sunny / gist:1173173
Created August 26, 2011 10:43
Checklist de projet Web
En amont
- Hébergeur :
- Informations techniques pour se connecter à l'hébergeur :
- Contraintes de langage de programmation, de CMS, de formats, d'applications :
- Contraintes de langage de programmation sur l'hébergeur :
- Contraintes de navigateurs (IE6, Smartphones, tablettes, …) :
- Qui va mettre à jour le site :
- Niveau technique de ceux qui vont mettre à jour le site :
- Contenus qui vont être mis à jour (textes, menus, arborescence, …) :
- Langues :
@sunny
sunny / gist:1216110
Created September 14, 2011 08:33
AppleScript Droplet that adds read/write permissions on all the dropped files and folders
-- "Mal aux droits" droplet
on open the_files
repeat with f in the_files
set f to POSIX path of f
do shell script "sudo chmod -R a+rw " & quoted form of f with administrator privileges
end repeat
end open
#!/usr/bin/env ruby
abort("Usage: #{$0} width height") if ARGV.size != 2
w = ARGV[0].to_f
h = ARGV[1].to_f
d = w / h
while w > 0 do
h = w / d
@sunny
sunny / gist:1316199
Created October 26, 2011 12:25
idees-de-dev
- plugin wordpress qui retire les accents et caractères bizarres dans les noms de fichiers et les slugs
- ajouter version opera à https://github.com/chriseppstein/compass/blob/stable/frameworks/compass/stylesheets/compass/css3/_gradient.scss
- site qui t'indique tes chansons mal taguées si tu donne ton nom d'utilisateur Last.fm
- web app qui teste si le md5 de ton pass existe sur google
- script permettant d'être dj sous format texte
- JS qui transforme les class=tel en href=tel si le device peut s'en servir
- police d'écriture qui ajoute les caractères unicodes manquants sous Windows (e.g ▿▸▶◀▸▴☛☜☝☞☟ ✑✒⎋)
- JS qui insère des espaces fines (ou insécables) automatiquement où on en attends en Français (s/ [!?:;]/thinsp-ou-nbsp-selon-le-navigateur/)
- Edith fonctionnant avec l'attribut HTML contenteditable
- Edith with automatic versionning (git?)
<?
function log_info($s) {
$fd = @fopen(LOG_FILE, 'a');
if (!$fd)
throw new Exception(sprintf(l("Impossible d'ouvrir le fichier %s en écriture"), LOG_FILE));
$saved = @fwrite($fd, $s . "\n");
if (!$saved)
throw new Exception(sprintf(l("Impossible d'écrire dans le fichier %s"), LOG_FILE));
fclose($fd);
}
@sunny
sunny / bnpparibas-pf.term
Created November 17, 2011 17:20
Consular example
before { run "cd /Volumes/data13/Sites/bnpparibas-pf" }
tab "sass --watch -g wordpress/wp-content/themes/bnpparibas-pf/css"
tab do
run "mate wordpress/wp-content/themes/bnpparibas-pf"
run "open http://treize.local/bnpparibas-pf/fr"
run "open ."
run "coffeewatch wordpress/wp-content/themes/bnpparibas-pf/js"
end
@sunny
sunny / retried.rb
Created November 23, 2011 11:03
Retried ruby helper
# Helper to retry exceptions. Returns true after it has been called the number
# of times given.
#
# Options hash argument:
# - times: int number of times to try again before returning true
# - sleep: int seconds to wait between each retry
# - name: symbol (defaults to :default) to use if you use several retried in
# the same program.
#
# Example:
@sunny
sunny / to-flv
Created December 5, 2011 12:12
Video to flv via ffmpeg
#!/bin/sh
# to-flv source.wav 400x300 4:3 [sortie.flv]
set -e
[ "$3" == "" ] && echo "Usage: $0 source.wmv 400x300 4:3 [sortie.flv]" && exit
export=$4
[ "$export" == "" ] && export="$1.flv"
[ -f "$export" ] && echo "Le fichier $export existe déjà" && exit
@sunny
sunny / sunnytize.php
Created December 7, 2011 10:14 — forked from LanF3usT/sunnytize.php
WordPress plugin that removes evil characters in file names
<?php
/*
Plugin Name: Sunnytize
Plugin URI:
Description: A better file name sanitizer
Version: 2.0
Author: Sunny Ripert, Bastien Maillard, Guillaume Morisseau
Author URI: http://sunfox.org
*/