Skip to content

Instantly share code, notes, and snippets.

View KittyGiraudel's full-sized avatar
🐈

Kitty Giraudel KittyGiraudel

🐈
View GitHub Profile
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created June 6, 2015 13:48
Generated by SassMeister.com.
// ----
// Sass (v3.4.13)
// Compass (v1.0.3)
// ----
////
/// String to number converter
/// @author Hugo Giraudel
/// @access private
////
@KittyGiraudel
KittyGiraudel / main.scss
Last active April 5, 2022 19:11
From: Architecturing a Sass project
// Sass utilities
@import "helpers/variables";
@import "helpers/functions";
@import "helpers/mixins";
@import "helpers/placeholders";
// Vendors and external stylesheets
@import "vendors/bootstrap";
@import "vendors/jquery-ui";
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created June 20, 2014 16:20
Generated by SassMeister.com.
// ----
// Sass (v3.3.8)
// Compass (v1.0.0.alpha.19)
// ----
$z-layers: (
"goku": 9001,
"shoryuken": 8000,
"modal": (
"base": 500,
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created February 8, 2016 14:47
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
/// Map of breakpoints
/// @type Map
$breakpoints: (
'small': '(min-width: 860px)',
'medium': '(min-width: 1000px)',
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Created November 16, 2015 14:58
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
/// Performs right-to-left function composition.
/// The rightmost function may have any arity;
/// the remaining functions must be unary.
///
/// @see http://ramdajs.com/docs/#compose Ramda Compose
///
/// This function is exactly like `map-get` except it goes deeper.
/// You pass the map as first argument and then an unlimited number of keys to be accessed.
/// If a key cannot be reached, the function aborts and returns `null`.
@function map-deep-get($map, $keys...) {
@each $key in $keys {
$map: map-get($map, $key);
@if (type-of($map) == 'null') { @return $map; }
}
const { exec } = require('child_process')
const { promisify } = require('util')
const chalk = require('chalk')
// See: https://docs.npmjs.com/about-audit-reports#severity
const SEVERITY_LEVELS = ['low', 'moderate', 'high', 'critical']
const SEVERITY_THRESHOLD = 'critical'
const run = promisify(exec)
// Get the output of a command. If the command exits with a non-zero code, try
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active November 18, 2021 14:01
Generated by SassMeister.com.
// ----
// Sass (v3.3.14)
// Compass (v1.0.1)
// ----
////
// I have written a lot of different `str-replace` Sass functions over
// the months yet none of my tries were succeeding in making the new substring
// able to contain the one to replace (e.g. `str-replace($str, "a", "ab")`).
// Thanks to Valérian Galliat (@valeriangalliat), I finally managed to build
@KittyGiraudel
KittyGiraudel / MyCoolComponent.js
Last active January 1, 2021 07:24
A simple textarea + counter component, fully commented for React beginners. :)
import React from 'react';
import MyCoolTextarea from '../MyCoolTextarea';
import MyCoolCounter from '../MyCoolCounter';
const MyCoolComponent = React.createClass({
// Define a method on the parent component describing what should happen when
// the textarea gets updated. At this point, the only thing needed is to store
// the length of the textarea’s content in a state on the parent component.
//
@KittyGiraudel
KittyGiraudel / gist:9488917
Created March 11, 2014 16:04
A question regarding Sass & Gzip

About Sass and Gzip

Hey guys! I have a question regarding Sass usage and Gzip compression. If anyone knows something, be sure to share. :)

A quick reminder

It's good practice to use Sass @extend rather than including mixins when possible because of the way Sass handles @extend. To put it simple, it doesn't take the CSS content from the extended selector to place them in the extending one. It works the other way around: it takes the extending selector and append it to the extended selector.

Placeholder