Skip to content

Instantly share code, notes, and snippets.

View LanF3usT's full-sized avatar

Bastien Maillard LanF3usT

  • Freelance
  • Paris
View GitHub Profile
@LanF3usT
LanF3usT / sunnytize.php
Created November 28, 2011 15:40 — forked from theamnesic/sunnytize.php
WordPress plugin that removes evil characters in file names
<?php
/*
Plugin Name: Sunnytize
Plugin URI:
Description: A better file name sanitizer
Version: 1.0
Author: Sunny Ripert
Author URI: http://sunfox.org
*/
@LanF3usT
LanF3usT / twitter.coffee
Created July 20, 2012 12:27
Affichage des derniers tweets
$.fn.twitterCallback = (twitters) ->
return @ if @length == 0
statusHTML = []
i = 0
while i < twitters.length
username = twitters[i].user.screen_name
status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, (url) ->
"<a href=\"" + url + "\">" + url + "</a>"
).replace(/\B@([_a-z0-9]+)/g, (reply) ->
@LanF3usT
LanF3usT / scrollTo.coffee
Last active October 8, 2015 00:10
ScrollTo with #hash
# Console log
window.log = ->
console?.log?(arguments...)
# Vérification de l'historique du navigateur
history_enabled = ->
return Boolean(
window.history and window.history.pushState \
and window.history.replaceState \
and not (RegExp(" Mobile\\/([1-7][a-z]|(8([abcde]|f(1[0-8]))))", "i")).test(navigator.userAgent) or (/AppleWebKit\/5([0-2]|3[0-2])/i).test(navigator.userAgent)
@LanF3usT
LanF3usT / git-deploy.sh
Created October 22, 2012 12:59 — forked from sunny/git-deploy.sh
$ git deploy
#!/bin/bash
# Git push then pull over ssh
#
# Supposing you have these environments on the same ssh git remote:
# project/origin.git
# project/dev/.git
# project/prod/.git
#
# You can then push the current branch and pull it in dev/ and prod/ by doing:
# $ git deploy dev