Skip to content

Instantly share code, notes, and snippets.

View floriangouy's full-sized avatar

Florian Gouy floriangouy

View GitHub Profile
@floriangouy
floriangouy / Bookmarlet - Git Commit Message.js
Created March 23, 2017 15:37
Bookmarklet: Generate a Git commit message from your Redmine task or Mantis bug web page.
// Transform this source into a bookmarklet on http://bookmarklets.org/maker/
var url = window.location.href;
// Redmine Issue -> Git Commit Message
if (url.indexOf('redmine') > -1) {
var story = window.document.querySelectorAll('#content .subject p')[0].innerText;
var task = window.document.querySelectorAll('#content h2')[0].innerText;
var detail = window.document.querySelectorAll('#content .subject h3')[0].innerText;
var message = url + ' ' + story + ' - ' + task + ': ' + detail;
@floriangouy
floriangouy / viewunits.scss
Last active February 22, 2017 17:36 — forked from seavor/viewunits.scss
Sass Mixin for V-Units to PXs for unsupported devices (vw, vh, vmin, vmax)
@function vunit($input, $width, $height){
@if unit($width) != px or unit($height) != px {
@error "function vunit() dimensions should contain a px unit. +[" + $width + ", " + $height +"]";
}
// Store $input unit
$unit: unit($input);
// Remove unit from $input and convert to ratio
$ratio: $input / ($input * 0 + 1) / 100;
// Calc and store return values