Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am chrissi2812 on github.
  • I am flotschi (https://keybase.io/flotschi) on keybase.
  • I have a public key ASBdCyUXS8dqfwqpodWMIOrCAii6vdbdIkkTUTdmT6y7Iwo

To claim this, I am signing this object:

@Chrissi2812
Chrissi2812 / TextColor.scss
Created April 26, 2017 12:01
Sass Auto Text Color
//YIQ Implementation
@function yiq($color) {
$red : red($color);
$green: green($color);
$blue : blue($color);
@return (($red*.299)+($green*.587)+($blue*.114));
}
@function color-contrast($background, $dark:#000, $light:#fff) {
div {
$colors: (
#c82639,
#ef8e00,
#9bbc1a,
#28649a,
);
$l: length($colors);
@each $color in $colors {
$i: index($colors, $color);
@Chrissi2812
Chrissi2812 / .htaccess
Created March 20, 2017 12:00
static brotli and gzip(zofpli) resources
# Rules to correctly serve gzip compressed CSS and JS files.
# Requires both mod_rewrite and mod_headers to be enabled.
<IfModule mod_headers.c>
# Serve brotli compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} br
RewriteCond %{REQUEST_FILENAME}\.br -s
RewriteRule ^(.*)\.css $1\.css\.br [QSA]
# Serve gzip compressed CSS files if they exist and the client accepts gzip.
RewriteCond %{HTTP:Accept-encoding} gzip