Skip to content

Instantly share code, notes, and snippets.

View botmaster's full-sized avatar
🎧

Pascal Achard botmaster

🎧
View GitHub Profile
@botmaster
botmaster / my.store.js
Created March 3, 2022 08:27
Basic Vuex setup
// State object
const state = {
variable1: 0,
variable2: 'value2',
variable3: 'value3',
_internalTimeout: null,
isLoading: false,
hasError: false,

SASS/SCSS/CSS Spacing Utility Classes

Following @ilicmarko's comment, here's my spacing.scss file…

(see spacing.scss)

…which generates the following spacing utility classes…

(see spacing.css)

const inBrowser = typeof window !== 'undefined'
// get user agent
const UA = inBrowser && window.navigator.userAgent.toLowerCase()
// detect browser
const isIE = UA && /msie|trident/.test(UA)
const isIE9 = UA && UA.indexOf('msie 9.0') > 0
const isEdge = UA && UA.indexOf('edge/') > 0
const isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge
@botmaster
botmaster / modifiers.scss
Created April 2, 2020 09:34 — forked from sarahdayan/modifiers.scss
Sass Modifiers Mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
@botmaster
botmaster / SassMeister-input.scss
Created January 31, 2020 10:09 — forked from lazabogdan/SassMeister-input.scss
Sass spacing utility
// ----
// libsass (v3.3.2)
// ----
$spacer: 1rem;
$spacer-x: $spacer;
$spacer-y: $spacer;
$spacers: ();
@botmaster
botmaster / 51-noto-color-emoji.conf
Created January 5, 2020 16:49 — forked from charveey/51-noto-color-emoji.conf
Enabling Color Emoji in Chrome (Linux)
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
You need Noto Color Emoji installed in your machine.
Save this file in ~/.config/fontconfig/conf.d/ or /etc/fonts/conf.d/ (system-wide)
-->
<fontconfig>
<match target="scan">
<test name="family">
// clearfix
@mixin clearfix {
&::after {
content: "";
display: block;
clear: both;
}
}
// edit font rendering -> tip: use for light text on dark backgrounds
@botmaster
botmaster / SCSS.md
Created August 28, 2017 09:45 — forked from jareware/SCSS.md
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso

@botmaster
botmaster / load-images.js
Created May 24, 2017 19:46 — forked from mattdesl/load-images.js
load images in parallel
function loadImage(url, callback) {
var image = new Image();
image.onload = function() {
callback(null, image);
};
image.onerror = function() {
callback(new Error('Could not load image at ' + url));
};
image.src = url;
}
@botmaster
botmaster / cordova-plugin-guide.md
Created May 17, 2017 11:18 — forked from mlynch/cordova-plugin-guide.md
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction