Skip to content

Instantly share code, notes, and snippets.

View guahsu's full-sized avatar

GuaHsu guahsu

View GitHub Profile
@brandonmwest
brandonmwest / gist:6262934
Last active December 22, 2020 09:02
Custom liquid block for Jekyll example
#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)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 15, 2024 21:14
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@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.

@matthewepler
matthewepler / README.md
Last active May 17, 2020 05:12
create-react-app linting setup with 'standard' style

Setup Your Machine

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 running nvm 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.
@javilobo8
javilobo8 / download-file.js
Last active July 1, 2024 23:21
Download files with AJAX (axios)
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);
@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active June 20, 2024 13:06
Install NVM, Node.js, Yarn via Homebrew
@matt-bailey
matt-bailey / github-pages-custom-domain-gandi-dns-records.md
Last active May 6, 2024 21:44
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

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
@tomhicks
tomhicks / plink-plonk.js
Last active July 16, 2024 02:59
Listen to your web pages