Skip to content

Instantly share code, notes, and snippets.

View Riske's full-sized avatar

Patrik Riske Riske

  • Gothenburg, Sweden
View GitHub Profile
@Riske
Riske / inline-svg-function.scss
Created March 18, 2020 10:09 — forked from JacobDB/inline-svg-function.scss
Inline SVG function [SASS]
// Replace letters
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@if $index {
@return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);
}
@return $string;
}
@Riske
Riske / git_notes.md
Created November 22, 2019 08:34 — forked from jaygooby/git_notes.md
Git, you bloody git

Remove all local tracking branches to a remote & then delete the remote

git remote prune origin && git remote rm origin

Force checkout a branch to avoid the commit or stash your changes warning

Sometimes when you want to checkout a branch, even though your current branch is clean, you'll get a failed partial checkout, because a file in your current branch will be changed by the new branch (Looking at you .xcodeproj files). As long as you know your current branch is clean and up-to-date, -f force the checkout

git checkout -f the_branch

@Riske
Riske / media-query.css
Created July 13, 2019 11:54 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@Riske
Riske / shadows.scss
Last active May 7, 2018 08:45 — forked from paulmelnikow/shadows.scss
Sass Mixin: Google Material Design Shadow
// A mixin which helps you to add depth to elements according to the Google Material Design spec:
// http://www.google.com/design/spec/layout/layout-principles.html#layout-principles-dimensionality
//
// Please note that the values given in the specification cannot be used as is. To create the same visual experience
// the blur parameter has to be doubled.
//
// Adapted from a LESS version at https://medium.com/@Florian/freebie-google-material-design-shadow-helper-2a0501295a2d
//
// Original Author: Florian Kutschera (@gefangenimnetz), Conceptboard GmbH (@conceptboardapp)
//
// Material color selector
//
// @group Standard
// @author Nils Kaspersson (Original), @author Patrik Riske (HSL, Minor Modifications, Updated colors)
// @link https://github.com/nilskaspersson/Google-Material-UI-Color-Palette
//
// @author Patrik Riske (HSL, Text-values, text-function, Minor Modifications)
//
// @example .classname {background-color: material-color($blue);}
// @output .classname {background-color: hsl(228, 097%, 066%); }
@Riske
Riske / _baseline.scss
Created June 15, 2016 23:27 — forked from dmitriz/_baseline.scss
Aligning type to baseline the right way with SASS
// font-size of the regular font used
$base-font-size: 16px;
// it is convenient to declare a fixed base-line-height,
// so every other line-height is a simple multiple of base-line-height
$base-line-height: 21px; // 1.5 * base-font-size
// allow fractional line-height as integer multiple of base-line-height / line-height-scale
$line-height-scale: 1;
@Riske
Riske / _decimal.scss
Created October 16, 2015 12:39 — forked from terkel/_decimal.scss
Rounding decimals in Sass
// _decimal.scss | MIT License | gist.github.com/terkel/4373420
// Round a number to specified digits.
//
// @param {Number} $number A number to round
// @param {Number} [$digits:0] Digits to output
// @param {String} [$mode:round] (round|ceil|floor) How to round a number
// @return {Number} A rounded number
// @example
// decimal-round(0.333) => 0
$element-separator: '__' !default;
$modifier-separator: '--' !default;
@function contains-modifier($selector) {
$selector: selector-to-string($selector);
@if str-index($selector, $modifier-separator) {
@return true;
} @else {
@return false;
}
# SASS
.sass-cache
*.css.map
# OsX
.DS_Store
.AppleDouble
.LSOverride
## Icon must end with two \r
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset