This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tu utilises ça sur ta page | |
FB.Event.subscribe("comment.create", comment_callback); | |
// La fonction JS qui va etre appelée et faire une requete ajax | |
window.comment_callback = function() { | |
$.ajax({ | |
url: "/poke", | |
type: "get", | |
data: "url=" + document.URL + "&kind=comment" | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: loc = window.location.protocol + '//' + window.location.hostname + window.location.pathname; if(loc.indexOf("destination")>0){ window.location=window.location.protocol + '//' + window.location.hostname + '/admin/categories' + window.location.pathname.replace('destinations','').replace('/conseils','') + '/edit' } else if (loc.indexOf("/conseils/")>0){ window.location=window.location.protocol + '//' + window.location.hostname + '/admin/questions/' + window.location.pathname.split("/")[3] + '/edit' } else {window.location=window.location.protocol + '//' + window.location.hostname+ '/admin/profiles/' + window.location.pathname.split("/")[2] + '/edit' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function () { | |
<%= "flash('#{flash[:notice]}')" if flash[:notice] %> | |
}); | |
function flash(message) { | |
$('#flash').html(message).slideDown("slow").delay(2500); | |
$('#flash').html(message).slideUp("slow"); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.wrapper{width:960px;margin:0 auto;} | |
.hidden{display:none;} | |
.flash{ | |
-moz-border-radius-bottomright:5px; | |
-webkit-border-bottom-right-radius:5px; | |
-moz-border-radius-bottomleft:5px; | |
-webkit-border-bottom-left-radius:5px; | |
font-size:16px; | |
text-align:center; | |
position:fixed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<title>Amblot - Solutions pour les développements Electroniques et Mécaniques</title> | |
<link rel="stylesheet" href="http://www.amblot.com/AmblotV02/Styles/Accueil.css" type="text/css"> | |
<link rel="stylesheet" href="http://www.amblot.com/AmblotV02/Styles/nivo-slider.css" type="text/css" media="screen" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script src="http://www.amblot.com/AmblotV02/Styles/jquery.nivo.slider.pack.js" type="text/javascript"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh deploy@yourproject.com "mysqldump -u root -p yourproject_production" | mysql -u root yourproject_development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.action_controller.asset_host = "http://yourproject.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.action_controller.asset_host = Proc.new { |source| | |
if source.index('/images') | |
"http://yourproject.com" | |
else | |
"http://localhost:3000" | |
end | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def seethreepio(text, from = 'fr', to = 'en') | |
escaped_text = CGI::escape(text) | |
host = Net::HTTP.new("www.googleapis.com",443) | |
host.use_ssl = true | |
body = JSON.parse( | |
host.get("/language/translate/v2?key=YOUR_KEY_GOES_HERE&source=#{from}&target=#{to}&q=#{escaped_text}").body) | |
body['data']['translations'].first['translatedText'] | |
end |
OlderNewer