Skip to content

Instantly share code, notes, and snippets.

View rodrigopasc's full-sized avatar
👨‍💻
Coding

Rodrigo Paschoaletto rodrigopasc

👨‍💻
Coding
View GitHub Profile
@benbonnet
benbonnet / nginx_source_pagespeed_passenger_ubuntu.md
Last active March 9, 2021 16:39
nginx from source with pagespeed and passenger on ubuntu 16.04 and above
sudo apt-get -y update
sudo apt-get install -y build-essential libcurl4-openssl-dev unzip software-properties-common git libpcre3-dev libpcre3

adding zlib, openssl and pcre

cd && mkdir sources && cd sources
wget https://downloads.sourceforge.net/project/pcre/pcre/8.41/pcre-8.41.tar.gz && tar xzvf pcre-8.41.tar.gz
@navneetkumar
navneetkumar / aws-provision-cf.json
Created December 5, 2016 18:30
Lambda Infra Cloud Formation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Stack to create Infra resources for polaris",
"Parameters": {
"BucketName": {
"Description": "Deployment S3 Bucket is where project is deployed after mvn deploy command.",
"Type": "String",
"MinLength": "3",
"MaxLength": "63",
"Default": "<BUCKETNAME>"
@taranda
taranda / dynamic-critical-path-css.md
Last active July 7, 2021 19:53
Dynamically Add Critical CSS to Your Rails App

Dynamically Add Critical CSS to Your Rails App

Optimizing the delivery of CSS is one way to improve user experience, load speed and SEO of your web app. This involves determining the "critical path CSS" and embeding it into the html of your page. The rest of the CSS for the site is loaded asynchronously so it does not block the rendering of your "above the fold" content. This Gist will show you how to dynamically generate critical path CSS for your Rails app.

In this example we will use the mudbugmedia/critical-path-css gem.

Prerequisites

You will need to set up caching and Active Job in your Rails app. I recommend using a thread-safe background job manager like resque.