Skip to content

Instantly share code, notes, and snippets.

View czj's full-sized avatar

Clément Joubert czj

View GitHub Profile
@czj
czj / gist:1149177
Created August 16, 2011 14:11
BNP Paribas almost-automatic login
var url = "https://www.secure.bnpparibas.net/banque/portail/particulier/HomeConnexion?type=homeconnex&identifiant=secure_bnpparibas_net_20021206152735"
if (window.location != url)
{
window.location = url;
}
else
{
// Add your login here
document.logincanalnet.ch1.value = "";
@czj
czj / gist:1136386
Created August 10, 2011 08:42
Auto-login bookmarklet for Boursorama Banque (site beta août 2011)
if (window.location != 'https://www.boursorama.com/connexion.phtml')
{
window.location = 'https://www.boursorama.com/connexion.phtml';
}
else
{
document.getElementById('login').value = "";
document.getElementById('password').value = "";
document.getElementById('identification').submit();
}
@czj
czj / gist:1136385
Created August 10, 2011 08:41
Auto-login for Banque Populaire Ouest
var base_url = "https://www.secure3.banquepopulaire.fr/amserver/UI/Login?realm=ENTAO-ENV00030&goto=https%3A%2F%2Fwww.ibps.ouest.banquepopulaire.fr%3A443%2Fcyber%2Fibp%2Fate%2Fportal%2Finternet.html";
if (window.location != base_url)
{
window.location = base_url;
}
else
{
document.getElementById('IDToken1').value = "";
document.getElementById('IDToken2').value = "";
@czj
czj / nginx
Created July 17, 2011 10:00
Ubuntu Server 10.04 init.d file for nginx (installed by Passenger)
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@dhh
dhh / gist:1014971
Created June 8, 2011 18:09
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@dhh
dhh / gist:965746
Created May 11, 2011 01:33
Pjax helper
module Pjax
extend ActiveSupport::Concern
included do
layout ->(c) { pjax_request? ? false : 'application' }
end
private
def redirect_pjax_to(action, url = nil)
new_url = url_for(url ? url : { action: action })