Skip to content

Instantly share code, notes, and snippets.

View scsskid's full-sized avatar
:octocat:

Benedikt Gregor scsskid

:octocat:
View GitHub Profile
/**
* Convert font-size from px to rem with px fallback
*
* @param $size - the value in pixel you want to convert
*
* e.g. p {@include fontSize(12px);}
*
*/
// Function for converting a px based font-size to rem.
@scsskid
scsskid / css-visually-hidden.css
Created February 17, 2018 12:35
CSS: Visually hidden
.visually-hidden {
position: absolute !important;
clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
clip: rect(1px, 1px, 1px, 1px);
padding:0 !important;
border:0 !important;
height: 1px !important;
width: 1px !important;
overflow: hidden;
}
@mixin not($ignorList...) {
//if only a single value given
@if (length($ignorList) == 1){
//it is probably a list variable so set ignore list to the variable
$ignorList: nth($ignorList,1);
}
//set up an empty $notOutput variable
$notOutput: '';
//for each item in the list
@each $not in $ignorList {
@scsskid
scsskid / .htaccess
Last active April 27, 2018 20:23
Prevent File Caching src: https://stackoverflow.com/a/11724596
<filesMatch "\.(html|htm|js|css)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>
<?php
function addUrlParam($url, $param) {
$url_parts = parse_url($url);
parse_str($url_parts['query'], $params);
$params[$param[0]] = $param[1];
$url_parts['query'] = http_build_query($params);
//return http_build_url($url_parts); //pecl
return $url_parts['scheme'] . '://' . $url_parts['host'] . $url_parts['path'] . '?' . $url_parts['query'];
}
@mixin breakpoint($class) {
@if $class == xs {
@media (max-width: 767px) { @content; }
}
@else if $class == sm {
@media (min-width: 768px) { @content; }
}
@else if $class == md {
search/replace
Find what: ^\n
or
Find what: ^[\s]*?[\n\r]+
Replace With: (nothing, leave in blank).
var keepsHisWord;
keepsHisWord = true;
promise1 = new Promise(function(resolve, reject) {
if (keepsHisWord) {
resolve("The man likes to keep his word");
} else {
reject("The man doesnt want to keep his word");
}
});
console.log(promise1);
@scsskid
scsskid / dnsmasq.conf
Created May 12, 2019 09:03
Apache Local
address=/devl/127.0.0.1
@scsskid
scsskid / content.txt
Last active May 29, 2019 15:14
Kirby Nested Structure Field Loop & output of single nested instance examples (Content Structure inspired by Kirby Page Builder)
Builder:
-
text: |
Die zunehmende Urbanisierung stellt Städte vor eine Vielzahl von Herausforderungen – auch mit Blick auf die Mobilität: Mit der Einwohnerzahl wachsen auch die Verkehrsprobleme innerhalb von Ballungszentren. Der Verkehrssektor trägt über ein Viertel zum weltweiten Ausstoß klimaschädlicher Emissionen bei und wirkt sich negativ auf Umwelt und Gesundheit aus. Gleichzeitig stellt Mobilität ein Grundbedürfnis der Stadtbewohnerinnen und -bewohner dar und ist damit eine wichtige Voraussetzung für Wirtschaftswachstum, persönliches Wohlbefinden, Kreativität und soziale Integration. Um Städte wieder zu lebenswerten, sauberen und gesunden Orten zu machen, sind intelligente Lösungen gefragt.
(image: magazin-mobilitaet-1.svg)
_key: text
_uid: text_0