Skip to content

Instantly share code, notes, and snippets.

nilsandrey /
Created May 5, 2021 — forked from matthewjberger/
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache


Cheat Sheets are greate but they are not a substitute for learning the framework and reading the documentation as we most certainly have not covered every potential example here. Please refer to the Rails Command Line Docs for more information.

Command Line Generator Info


You can get all of this information on the command line.

rails generate with no generator name will output a list of all available generators and some information about global options. rails generate GENERATOR --help will list the options that can be passed to the specified generator.

nilsandrey / docker-fixports.ps1
Last active May 4, 2021
Workaround for Unable to bind ports: Docker-for-Windows & Hyper-V.
View docker-fixports.ps1
# 1. Disable hyper-v (which will required a couple of restarts)
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
# 2. When you finish all the required restarts, reserve the port you want so hyper-v doesn't reserve it back
# Notice: Include the port number is failing to you...50051 on sample...
netsh int ipv4 add excludedportrange protocol=tcp startport=50051 numberofports=1
# 3. Re-Enable hyper-V (which will require a couple of restart)
dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
View animate-focus.css
(prefers-reduced-motion: no-preference) {
:focus {
transition: outline-offset .25s ease;
outline-offset: 5px;
View boilerplate.html
<!-- Line by line explanation: -->
<!DOCTYPE html>
<html lang="en" class="no-js">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>Unique page title - My Site</title>
<script type="module">
nilsandrey / index.html
Created Apr 4, 2021
Scriptless HTML Menu
View index.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8" />
<meta name="viewport" content="initial-scale=1.0" />
<link href="style.css" rel="stylesheet">
<input type="checkbox" id="menu-toggle" />
nilsandrey /
Created Mar 16, 2021
NodeSource Node.js Binary Distribution: v14 in Ubuntu
# Using Ubuntu
curl -fsSL | sudo -E bash -
sudo apt-get install -y nodejs
nilsandrey / daemon.json
Last active Mar 16, 2021
Docker daemon can be set up to forward the logs to Syslog, which then logs into messages or a separate file if you configure Syslog correctly. (On CentOS7) Change your /etc/docker/daemon.json to something like this, and then restart docker daemon…
View daemon.json
"log-driver": "syslog",
"log-opts": {
"tag": "dockerlogs {{.Name}}/{{.ID}}"
View mock-pipe.ts
// If you want reusable util function for mocking pipes, you can try this option:
export function mockPipe(options: Pipe): Pipe {
const metadata: Pipe = {
return <any>Pipe(metadata)(class MockPipe {});