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
= f.fields_for :images,@image do |image_form| | |
= image_form.file_field :attachment, | |
onchange:"document.getElementById('preview').src = window.URL.createObjectURL(this.files[0]);document.getElementById('preview').classList.add('visible');;document.getElementById('imgpreview').classList.remove('hidden');" |
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
@mixin box-shadow($x:1px,$y:1px,$width:0px,$color:rgba(0, 0, 0, 0.1)) { | |
box-shadow: $x $y $width $color; | |
-webkit-box-shadow: $x $y $width $color; | |
-moz-box-shadow: $x $y $width $color; | |
} | |
@mixin inset($x:0px,$y:1px,$width:8px,$color:rgba(0, 0, 0, 0.8)){ | |
box-shadow: inset $x $y $width $color; | |
-webkit-box-shadow: inset $x $y $width $color; | |
-moz-box-shadow: inset $x $y $width $color; | |
} |
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
#css | |
.info,#people{display:block;width:100%} | |
.person{display:inline-block;width:30%} | |
<dic id="people"> | |
<div class="person" data-name="John Lennon" data-content="Lorem Ipsum..."><img src="photo.jpg" /></div> | |
<div class="person" data-name="Paul McCartney" data-content="Lorem Ipsum..."><img src="photo.jpg" /></div> | |
<div class="info"></ |
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
// 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
<div class='visible-phone no-flick' id='pan'> | |
<h1>Catégories</h1> | |
<ul> | |
<li class='first '><a href="/tele-series">Télé & Series</a></li> | |
<li class=' '><a href="/jeux-jouets">Jeux & Jouets</a></li> | |
<li class=' '><a href="/films">Films</a></li> | |
<li class=' '><a href="/musiques">Musiques</a></li> | |
<li class=' '><a href="/objets-et-deco">Objets et Déco</a></li> | |
<li class=' '><a href="/vetements">Vêtements</a></li> | |
<li class=' '><a href="/livres-bandes-dessinees">Livres & BD</a></li> |
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
$(document).on('click', '#pan li a', function(e) { | |
return $("#pan").toggleClass("toggle"); | |
}); |
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
#pan-button { | |
color: #FFF; | |
position: absolute; | |
top: 0px; | |
right: -60px; | |
padding: 10px 30px 10px 10px; | |
} | |
#pan { | |
-webkit-overflow-scrolling: touch; |
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
# Lowless compression & exif stripping | |
find . -iname "*.jpg" -exec jpegoptim --strip-all {} \; | |
# More compression for some style of your pics | |
find path/to/your/assets/*/style -type f -exec jpegoptim --strip-all -m85 {} \; |
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
after_post_process :compress | |
private | |
def compress | |
image = self.attachment | |
current_format = File.extname(image.queued_for_write[:original].path) | |
image.queued_for_write.each do |key, file| | |
reg_jpegoptim = /(jpg|jpeg|jfif)/i |
NewerOlder