Skip to content

Instantly share code, notes, and snippets.

View jonathanhoskin's full-sized avatar

Jono Hoskin jonathanhoskin

  • Auckland, New Zealand
View GitHub Profile
@mattbell87
mattbell87 / remote-wsl.md
Last active April 18, 2024 06:38
VSCode Remote: Connect to WSL2 from another machine

VSCode Remote: Connect to WSL2 from another machine

Do you want to do remote development on your WSL2 container in Visual Studio Code? Read this.

Proxy jump method

  1. On the host set up OpenSSH for Windows
  2. Run wsl --update to make sure you are running the latest WSL
  3. Open WSL and install another SSH server inside WSL with sudo apt-get install openssh-server
  4. Now run sudo systemctl enable --now ssh to automatically start ssh when WSL starts.
@dlangille
dlangille / nginx include unifi.conf
Last active January 17, 2022 18:29
nginx reverse proxy for unifi controller, so you can put a real cert in front of it.
# listen on port 80, and redirect to port 443
server {
listen 10.0.0.131:80;
server_name unifi01.int.unixathome.org;
error_log /var/log/nginx-unifi01.int.unixathome.org.error.log info;
access_log /var/log/nginx-unifi01.int.unixathome.org.access.log combined;
@peterforgacs
peterforgacs / Windows10AWSEC2.md
Last active April 18, 2024 23:53
Running Windows 10 on AWS EC2

Running Windows 10 on AWS EC2

Downloading the image

Download the windows image you want.

AWS vmimport supported versions: Microsoft Windows 10 (Professional, Enterprise, Education) (US English) (64-bit only)

So Home wont work.

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

#!/usr/bin/env bash
set -e
if [ -e static ]; then
rm -r static
fi
mkdir -p static
sass src/sass/main.scss > static/application.css
$(npm bin)/browserify src/js/main.js > static/application.js
@rpheath
rpheath / authlogic-to-devise.md
Last active December 30, 2020 14:35
Steps and troubleshooting tips when moving Authlogic to Devise.

How To: Authlogic to Devise

Step 1: Migration

  1. bin/rails g migration AuthlogicToDevise
  2. (see the file below for the actual migration, authlogic_to_devise.rb)
  3. bin/rake db:migrate

Step 2: Update Gemfile

  1. gem "devise", "~> 2.2.0"
  2. bundle install
@thuandt
thuandt / install_xenserver_usb.md
Created October 30, 2013 15:56
Create XenServer USB Install

Installing XenServer 6.2.0 from a USB Stick

  • Download the XenServer 6.2.0 ISO image

  • Format a USB stick using FAT32.

  • Use unetbootin to install the ISO to the USB stick. Use the “DiskImage” option instead of the “Distribution” one, and point it right to the ISO file.

  • Now we need to fix up some boot stuff (All paths are relative to the root of the USB drive)