This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This certainly is not the best way to do this. | |
// But I couldn't find an approach using the Sass elements for now. If you have a better approach please let me know. | |
// convention to a local variable | |
$_local: ( | |
// some stuff here | |
); | |
// if we need to add new entries that depends of the other ones we can do this: | |
$_local: map-merge( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This certainly is not the best way to do this. | |
// But I couldn't find an approach using the Sass elements for now. If you have a better approach please let me know. | |
// convention to a local variable | |
$_local: ( | |
// some stuff here | |
); | |
// if we need to add new entries that depends of the other ones we can do this: | |
$_local: map-merge( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// jQuery-style extend function | |
/// About `map-merge()`: | |
/// * only takes 2 arguments | |
/// * is not recursive | |
/// @param {Map} $object - first map | |
/// @param {ArgList} $objects - other maps | |
/// @param {Bool} $deep - recursive mode | |
/// @return {Map} | |
@function extend($object, $objects.../*, $deep */) { | |
$last: nth($objects, -1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Content of _map-dee-get.scss | |
/// https://css-tricks.com/snippets/sass/deep-getset-maps/ | |
/// Map deep get | |
/// @author Hugo Giraudel | |
/// @access public | |
/// @param {Map} $map - Map | |
/// @param {Arglist} $keys - Key chain | |
/// @return {*} - Desired value | |
@function map-deep-get($map, $keys...) { | |
@each $key in $keys { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$palette: (colors: (special: (black: #000000, black-87-opacity: rgba(0, 0, 0, 0.87), white: #ffffff, white-87-opacity: rgba(255, 255, 255, 0.87)), red: (50: #ffebee, 100: #ffcdd2, 200: #ef9a9a, 300: #e57373, 400: #ef5350, 500: #f44336, 600: #e53935, 700: #d32f2f, 800: #c62828, 900: #b71c1c, A100: #ff8a80, A200: #ff5252, A400: #ff1744, A700: #d50000, contrast: (50: rgba(0, 0, 0, 0.87), 100: rgba(0, 0, 0, 0.87), 200: rgba(0, 0, 0, 0.87), 300: rgba(0, 0, 0, 0.87), 400: rgba(0, 0, 0, 0.87), 500: #ffffff, 600: #ffffff, 700: #ffffff, 800: rgba(255, 255, 255, 0.87), 900: rgba(255, 255, 255, 0.87), A100: rgba(0, 0, 0, 0.87), A200: #ffffff, A400: #ffffff, A700: #ffffff)), pink: (50: #fce4ec, 100: #f8bbd0, 200: #f48fb1, 300: #f06292, 400: #ec407a, 500: #e91e63, 600: #d81b60, 700: #c2185b, 800: #ad1457, 900: #880e4f, A100: #ff80ab, A200: #ff4081, A400: #f50057, A700: #c51162, contrast: (50: rgba(0, 0, 0, 0.87), 100: rgba(0, 0, 0, 0.87), 200: rgba(0, 0, 0, 0.87), 300: rgba(0, 0, 0, 0.87), 400: rgba(0, 0, 0, 0.87), 500: # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Official rvm documentation: https://rvm.io/ | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
\curl -sSL https://get.rvm.io | bash | |
rvm install ruby --latest | |
gem install rails |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Official documentation: https://nodejs.org/en/download/package-manager/ | |
# First install npm using the link above (if you don't have it yet). Then: | |
# sudo is needed for some OSes, if it is not required on yours then you can remove it from the commands. | |
sudo npm install npm@latest -g | |
#Important! The option -f is used to force clean the npm cache. Take care about it. Anyway, I usually do this when I would like to install the latest NodeJS. | |
sudo npm cache clean -f | |
sudo npm install -g n | |
sudo n stable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param classNames | |
* @param className | |
* @returns {boolean} | |
*/ | |
export function hasClass(classNames, className) { | |
return new RegExp(` ${className} `).test(` ${classNames} `) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To fix the error: | |
`xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun` | |
You can do: | |
`xcode-select --install` | |
More info on: | |
`https://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kotlin.reflect.KMutableProperty1 | |
inline fun <reified T, Y> MutableList<T>.arrayListOfField(property: KMutableProperty1<T, Y?>): ArrayList<Y> { | |
val output = ArrayList<Y>() | |
this.forEach {t: T -> | |
@Suppress("UNCHECKED_CAST") | |
output.add(property.get(t) as Y) | |
} |
OlderNewer