![]() ![]() ![]() To compile your SASS files into CSS files from command line, install SASS gem and check it version after: $ gem install sass $ sass -v # Sass 3.4.23 BowerĪ newer option to NPM packages suitable for Webpack users. Install it by: $ gem install bundler SASS To list all your gems: $ gem list Bundler If you are facing problems whichever task, try to update your system running: Now, you can list all Ruby version and install your chosen one: # list all available versions: $ rbenv install -l # install a Ruby version: $ rbenv install 2.4.1 ![]() git clone ~/.rbenv/plugins/ruby-build $ ~/.rbenv/plugins/ruby-build $ echo ‘export PATH=”$HOME/.rbenv/plugins/ruby-build/bin:$PATH”’ > ~/.bashrc $ source ~/.bashrc Then check if rbenv was installed: $ type rbenv #=> "rbenv is a function"Īfter all, install ruby-build as a plugin to enable rbenv install command. Open a new tab in your terminal to restart Path. To install it: $ git clone ~/.rbenv $ cd ~/.rbenv & src/configure & make -C src $ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' > ~/.bashrc $ echo 'eval "$(rbenv init -)"' > ~/.bashrc $ ~/.rbenv/bin/rbenv init Homebrew stuffs brew cask install slack brew cask install imageoptim brew cask install sublime-text brew cask install visual-studio-code brew cask install dash brew cask install firefox brew cask install google-drive brew cask install docker rbenvįor compile SASS, for example, you will need Ruby installed, and the best way to manager Ruby versions is rbenv. To git clone a repository from your GitHub account into your desktop, access, add a Title and your copied public key.Īt your terminal, to git clone a GitHub repository, type: It starts with ssh-rsa and you can view it typing: Now, if you need to give someone access, for instance, clone GitHub repositories, you should copy your public key. To generate these keys, type in your Terminal:Īnswer the questions and at the end you are going to have a a pair of keys into folder ~/.ssh. To clone a project from GitHub, for example, you need a public/private rsa key pair. You can configure aliases shortcuts to your bash terminal commands, like this: git config -global checkout git config -global alias.br branch git config -global alias.ci commit git config -global alias.st status git config -global alias.ps push git config -global pull git config -global alias.last 'log -1 HEAD' SSH Keys $percentChange = (1 - $optimizedSize / $originalSize) * 100 Įcho sprintf("The image is now %.Then, access Git configuration file and update your name and email: $optimizerChain = OptimizerChainFactory::create() foreach ($images as $image) Pro Tip: Check the optimization percentageĮver wondered how many percent does this package shrink your image? We can do it for testing by simple code snippet. Now, back in your controller where you’re storing or playing around with image, we’ll add our optimzer and process our images through it. composer require spatie/laravel-image-optimizer Optimize Images right away In this step, we’ll install this image optimization package in our Laravel application. Installing Optimizing Tools on Ubuntu sudo apt-get install jpegoptim sudo apt-get install optipng sudo apt-get install pngquant sudo npm install -g svgo sudo apt-get install gifsicle sudo apt-get install webp Installing Optimizing Tools on Mac brew install jpegoptim brew install optipng brew install pngquant brew install svgo brew install gifsicle brew install webp Installing package in your Laravel application We’ll install the following optimization tools on Mac & Ubuntu. Installation may vary depends on your operating system. This package make use of few optimization tools to get going. Sometimes images can be reduced by 50% or more, yet, it can be difficult to string various tools together to optimize images in web applications.įor this short snippet tutorial, we’ll be using Spatie Image Optimizer Laravel Package to quickly setup image optimization in our Laravel project. Image optimization can greatly improve site performance, and is one of the most common issues I see in Google pagespeed insights reports. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |