#Generates a named anchor and wrapping tag from a string. | |
module Jekyll | |
class AnchorBlock < Liquid::Block | |
def initialize(tag_name, markup, tokens) | |
@tag = markup | |
super | |
end | |
def render(context) |
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.
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.
NOTE: You only need to do these steps once on your machine
-
Install ESlint globally on your machine:
npm install -g eslint
-
Make sure you have
nvm
installed. This is a way to handle multiple versions of Node on your machine. If you're not sure you have it, try runningnvm
in Terminal. If you get a help file, you have nvm! If not, run this command to install it:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash
- Install ESLint in your editor of choice.
- Note: if you already have SublimeLinter installed, you may need to disable the contributed linter package you normally use in order for the rest of this to work.
axios({ | |
url: 'http://localhost:5000/static/example.pdf', | |
method: 'GET', | |
responseType: 'blob', // important | |
}).then((response) => { | |
const url = window.URL.createObjectURL(new Blob([response.data])); | |
const link = document.createElement('a'); | |
link.href = url; | |
link.setAttribute('download', 'file.pdf'); | |
document.body.appendChild(link); |
Dear all Github friends,
I moved this gist to the Github repository.
Following this repository https://github.com/nijicha/install_nodejs_and_yarn_homebrew
You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.
Create the following A records:
@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |