Skip to content

Instantly share code, notes, and snippets.

View guysolamour's full-sized avatar

Guy-roland ASSALE guysolamour

View GitHub Profile
@guysolamour
guysolamour / jquery.mailto.js
Created November 15, 2017 17:16
JS: Jquery mailto plugin
(function($) {
$.fn.mailto = function() {
return this.each(function() {
var $el = $(this),
emailAdd = $el.attr("href").replace(/\s*\(.+\)\s*/, "@"),
emailClass = $el.attr('class'),
emailText = $el.html();
$(this).before('<a href="mailto:' + emailAdd + '" rel="nofollow" class="' + emailClass + '" title="Email ' + email_add + '">' + emailText + '</a>').remove();
});
@guysolamour
guysolamour / _PxToEm.scss
Created September 30, 2017 19:13
SASS mixin to convert pixel to em
/* Px to Em Converter
* @Author: Bashar Ayyash
* @Version: 1.0
* @Date: 04 May, 2013
* */
@function px_to_em($target, $context: $base-size) {
@if $target == 0 { @return 0 }
@return $target / $context + 0em;
}