1.) Download a Nerd Font
2.) Unzip and copy to ~/.fonts
3.) Run the command fc-cache -fv
to manually rebuild the font cache
import { Pipe, PipeTransform } from '@angular/core'; | |
@Pipe({ | |
name: 'toGb' | |
}) | |
export class ToGbPipe implements PipeTransform { | |
transform(value: number, args?: any): string { | |
return (value / 1073741824).toFixed(2).toString(); | |
} | |
} |
module ObjectExtension | |
# For any object... | |
def to_hash | |
hash = {} | |
instance_variables.each {|var| hash[var.to_s.delete("@")] = instance_variable_get(var) } | |
hash | |
end | |
## | |
# Update all attributes with values from a hash. Only update existing attributes. |
# Define cache store | |
# config.cache_store = :mem_cache_store | |
if ENV["REDIS_URL"].present? | |
config.cache_store = :redis_cache_store, { url: ENV["REDIS_URL"] } | |
else | |
config.cache_store = :file_store, "tmp/cache" | |
end |
OmniAuth.configure do |config| | |
# Always use /auth/failure in any environment | |
config.failure_raise_out_environments = [] | |
end |
{ | |
path: 'refresh' // See `AppComponent.watchForRefresh()` | |
}, | |
// ... | |
this._router.events | |
.pipe(filter(e => e instanceof NavigationEnd)) | |
.subscribe((e: NavigationEnd) => { | |
const current = e.urlAfterRedirects.substr(1); |
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.
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.
# 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 |
@media | |
(prefers-reduced-motion: no-preference) { | |
:focus { | |
transition: outline-offset .25s ease; | |
outline-offset: 5px; | |
} | |
} |
<!-- Line by line explanation: https://www.matuzo.at/blog/html-boilerplate/ --> | |
<!DOCTYPE html> | |
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Unique page title - My Site</title> | |
<script type="module"> |