Skip to content

Instantly share code, notes, and snippets.

View cdcharlebois's full-sized avatar

Conner Charlebois cdcharlebois

View GitHub Profile
@RussellHite
RussellHite / _field-width.scss
Created October 25, 2017 16:46
A mixin partial for limiting the width of input fields for Mendix
@mixin field-width($number, $side-padd) {
@for $i from 1 through $number{
.field-width-#{$i}.form-group .form-control, .field-width-#{$i}[class*="mx-name-textBox"] .form-control{
width: calc( #{$i} * 1em + #{$side-padd});
}
}
}
// Add this line in the inputs partial
@RussellHite
RussellHite / _flex-maker.scss
Created October 25, 2017 16:41
Flex Partials, _flex-maker to live in mixins and _flex for components
@mixin flex-items($number) {
@for $i from 1 through $number{
.flex-#{$i}{
flex: #{$i} 1 1%;
}
}
}
@akirattii
akirattii / background.js
Created December 2, 2016 03:45
Message passing of Chrome Extension example
/*****************************************************************
* onMessage from the extension or tab (a content script)
*****************************************************************/
chrome.runtime.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.cmd == "any command") {
sendResponse({ result: "any response from background" });
} else {
sendResponse({ result: "error", message: `Invalid 'cmd'` });
}