Skip to content

Instantly share code, notes, and snippets.

View cange's full-sized avatar
🧉

Christian Angermann cange

🧉
  • Hamburg, Germany
View GitHub Profile
@cange
cange / input.scss
Created July 10, 2023 10:16
Generated by SassMeister.com.
body {
color: blue;
@media screen and (resolution >= 0dppx) {
color:red;
}
}
@cange
cange / aliases.docker.zsh
Last active June 9, 2023 19:55
Convinients aliases for docker and docker compose
# Points to the global docker-compose config
local _compose_file="$HOME/workspace/services/docker-compose/docker-compose.yml"
# https://docs.docker.com/compose/reference/envvars/
if [[ -n "$COMPOSE_FILE" ]]; then
export COMPOSE_FILE="${COMPOSE_FILE}${COMPOSE_PATH_SEPARATOR:-":"}${_compose_file}"
else
export COMPOSE_FILE=$_compose_file
fi
@cange
cange / bookmarklet.js
Last active November 2, 2018 11:23
Bookmarklet for DOM node sizes analyzes
javascript:void(()=>{document.addEventListener("click",({target:e})=>{console.log("Parent node count",parentNodeCount(e),"depth of",depthNodeCount(e),"nodes with ",charCount(e),"chars in",e)});const depthNodeCount=e=>e.getElementsByTagName("*").length,charCount=e=>e.outerHTML.length,parentNodeCount=e=>{let t=e,n=0;for(;t.parentNode;)n++,t=t.parentNode;return n};})();
@cange
cange / Feature.js
Last active February 9, 2018 16:30
Mock a Ajax call with Jest test runner
class Feature {
load(url, callback) {
$.ajax({ url })
.done((data) => {
callback.apply(this, [null, data])
})
.fail((jqXHR) => {
callback.apply(this, [jqXHR.statusText])
})
}
@cange
cange / material-shadow.scss
Created November 19, 2017 12:10
Mapping of the Material Design Shadow suggestions - https://material.io/guidelines/resources/shadows.html
/* rem unit setup based on
:root {
font-size: 10px;
}
*/
/// @example
/// .foo { box-shadow: material-shadow(dp3); }
@function material-shadow($elevation) {
$umbra: rgba(black, .14);
$penumbra: rgba(black, .12);
@cange
cange / white_space_types.html
Last active August 29, 2015 14:27
Types of white spaces in html
en space:   
em space:   
3-per-em space:   
4-per-em space:   
6-per-em space:   
figure space:   
punctuation space:   
thin space:   
hair space:   
@cange
cange / fiddle.css
Last active August 29, 2015 14:25
CSS Spinning 3D cube for loading sequence
//
// Variables
// -------------------------------------
$blue: #00a3de;
$blue-light: #7fd1ee;
$blue-lightest: #e5f6fc;
$grey: #b5babd;
$side-color-a: $grey;
@cange
cange / fiddle.css
Last active August 29, 2015 14:25
Loading state button with Bootstrap buttons
$easing: cubic-bezier(0.6,0.15,0.4,0.85);
$timing: 250ms;
$offset: 2em;
$line-height-btn-base: 2.3;
$line-height-btn-xs: 1.5;
.btn-inner {
display: block;
-webkit-transform: translateY(0);
transform: translateY(0);
@cange
cange / _breakpoint.scss
Last active August 29, 2015 14:07
Media query breakpoint mixin based on bootstrap 3 variables
// breakpoints
@mixin breakpoint($point) {
//
// large
//
@if $point == large-only {
@media (min-width: $screen-lg-min) and (max-width: $screen-lg-min + 1) { @content; }
}
@else if $point == large-up {
@cange
cange / font_size.scss
Created June 26, 2013 14:44
Sass pixel to rem unit converter set by Nicole O'Sullivan
// converting a px based font-size to rem
@function calculate-rem($size) {
$rem-size: $size / $default-font-size;
@return #{ $rem-size }rem;
}
@mixin font-size($size) {
font-size: $size;
font-size: calcuate-rem($size);
}