Skip to content

Instantly share code, notes, and snippets.

View galaakk's full-sized avatar

Eric Dejonckheere galaakk

View GitHub Profile
@galaakk
galaakk / gist:3679163
Created September 8, 2012 19:52
CSS : Absolute center an image
img {
position: absolute;
top: 50%;
left: 50%;
width: 500px;
height: 500px;
margin-top: -250px; /* Half the height */
margin-left: -250px; /* Half the width */
}
@galaakk
galaakk / gist:3679179
Created September 8, 2012 19:53
CSS : Auto break word
-moz-hyphens:auto;
-ms-hyphens:auto;
-webkit-hyphens:auto;
hyphens:auto;
word-wrap:break-word;
@galaakk
galaakk / gist:3679185
Created September 8, 2012 19:54
CSS : Blurry text
.blur {
color: rgba(0, 0, 0, 0);
text-shadow: 0 0 5px rgba(0,0,0,0.5);
}
@galaakk
galaakk / gist:3679192
Created September 8, 2012 19:54
CSS : Simple image fullscreen
body {
background: url(image.jpg) no-repeat;
background-size: 100%;
}
@galaakk
galaakk / gist:3679205
Created September 8, 2012 19:56
CSS : Text columns
#content {
-webkit-column-count: 2;
-webkit-column-rule: 1px solid #bbb;
-webkit-column-gap: 2em;
-moz-column-count: 2;
-moz-column-rule: 1px solid #bbb;
-moz-column-gap: 2em;
column-count: 2;
@galaakk
galaakk / gist:3679211
Created September 8, 2012 19:57
jQuery : Scroll to anchor
$(document).ready(function() {
// Click event for any anchor tag that's href starts with #
$('a[href^="#"]').click(function(event) {
// The id of the section we want to go to.
var id = $(this).attr("href");
// An offset to push the content down from the top.
var offset = 60;
@galaakk
galaakk / gist:3679217
Created September 8, 2012 19:57
jQuery : Simple fade-out
$(function() {
$('#identifiant a').click(function(){
$('#identifiant').fadeOut(1000);
});
});
@galaakk
galaakk / gist:3679225
Created September 8, 2012 19:58
jQuery : Simple slide-up
jQuery(function($) {
$('.classe').live('click',function(){
$(this).parent().slideUp();
return false;
})
});
@galaakk
galaakk / gist:3679326
Created September 8, 2012 20:11
SCSS : Link mixin
@mixin lien(){
font-size:$linkFontSize;
background-color:$bgLinkColor;
color:$textLinkColor;
padding:$linkPaddingTop $linkPaddingRight $linkPaddingBottom $linkPaddingLeft;
border:$linkBorderSize $linkBorderColor $linkTexture;
@include border-radius($linkRadius);
@include transition-property($transitionProperty);
@include transition-duration($transitionDuration);
&:hover{
@galaakk
galaakk / send-mail.php
Created September 8, 2012 20:17
PHP : Simple e-mail send
<?php
$mail_to = 'myname@mydomain.com';
$name = $_POST['sender_name'];
$mail_from = $_POST['sender_email'];
$message = $_POST['sender_message'];
$subject = 'Subject ' . $name;
$body_message = 'From: ' . $name . "\r\n";