Skip to content

Instantly share code, notes, and snippets.

View joellesenne's full-sized avatar
🏠
Working from home

Joël Lesenne joellesenne

🏠
Working from home
View GitHub Profile
@joellesenne
joellesenne / createNewGithubPages.sh
Created September 4, 2020 12:07
Create new Github Pages
# Create new Github Pages
$ git branch gh-pages
$ git checkout gh-pages
$ echo "# This application is in production mode, more information here in develop mode" >> README.md
$ git subtree push --prefix dist origin gh-pages
$ git rm -r dist
@joellesenne
joellesenne / pushAnExistingRepository.sh
Created September 4, 2020 12:06
Push an existing repository from the command line
# Push an existing repository from the command line
$ git remote add origin https://github.com/<User>/<Path>.git
$ git push -u origin master
@joellesenne
joellesenne / createNewRepository.sh
Last active September 4, 2020 12:05
Create a new repository on the command line
# Create a new repository on the command line
$ echo "# name project" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin https://github.com/<User>/<Path>.git
$ git push -u origin master
@joellesenne
joellesenne / gitInitialCommit.sh
Last active September 4, 2020 12:05
git commit -m <message>
# git commit -m <message>
$ git commit -m "🎉 Initial commit."
@joellesenne
joellesenne / _media.scss
Last active September 7, 2020 13:41
Media Queries in SCSS
// Media Queries in SCSS <https://css-tricks.com/approaches-media-queries-sass/#landon-schropps-technique>
// Variables
$tablet-width: 768px;
$desktop-width: 1024px;
@mixin tablet {
@media (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) {
@content;
}
@joellesenne
joellesenne / _prefix.scss
Last active September 7, 2020 13:38
Sass Mixins to Kickstart Your Project
// Sass Mixins to Kickstart Your Project <http://www.sitepoint.com/sass-mixins-kickstart-project/#vendor-prefixes>
@mixin prefix($property, $value, $vendors: webkit moz ms o) {
@if $vendors {
@each $vendor in $vendors {
#{"-" + $vendor + "-" + $property}: #{$value};
}
}
#{$property}: #{$value};
}
@joellesenne
joellesenne / _animation.scss
Last active September 4, 2020 08:16
SASS Mixins for CSS animations
// SASS Mixins for CSS animations <https://joshbroton.com/quick-fix-sass-mixins-for-css-keyframe-animations/>
@mixin animation($animate...) {
$max: length($animate);
$animations: '';
@for $i from 1 through $max {
$animations: #{$animations + nth($animate, $i)};
@if $i < $max {
$animations: #{$animations + ", "};
@joellesenne
joellesenne / _keyframes.scss
Created September 4, 2020 08:06
SASS Mixins for CSS @Keyframes
// SASS Mixins for CSS @keyframes <https://joshbroton.com/quick-fix-sass-mixins-for-css-keyframe-animations/>
@mixin keyframes($animationName) {
@-webkit-keyframes #{$animationName} {
@content;
}
@-moz-keyframes #{$animationName} {
@content;
}
@-o-keyframes #{$animationName} {
@content;
@joellesenne
joellesenne / _ellipsis.scss
Created September 4, 2020 06:37
SCSS ellipsis mixin
/* SCSS ellipsis mixin <https://codepad.co/snippet/scss-ellipsis-mixin> */
@mixin ellipsis($width: 100%) {
display: inline-block;
max-width: $width;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* How to use
@joellesenne
joellesenne / _opacity.scss
Last active September 4, 2020 06:35
CSS Opacity SASS MIxin For IE, FireFox, Chrome and Safari
// CSS Opacity SASS MIxin For IE, FireFox, Chrome and Safari <https://coderwall.com/p/mca5xw/sass-opacity-mixin>
@mixin Opacity($value){
$IEValue: $value*100;
opacity: $value;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity="+$IEValue+")";
filter: alpha(opacity=$IEValue);
}
/* How to use
img.preload{