resources :zombies, only: [:index, :show]
resources :humans, except: [:destroy, :edit, :update]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
A summary of the Rails Guides on Routes, plus other tips.
The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views.
Examples
# Redirects /orders/report to orders#report.
get 'orders/report', to: 'orders#report'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"bracket_styles": { | |
"default": { | |
"icon": "dot", | |
// BH1's original default color for reference | |
// "color": "entity.name.class", | |
"color": "brackethighlighter.default", | |
"style": "highlight" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const copyToClipboard = str => { | |
const el = document.createElement('textarea'); // Create a <textarea> element | |
el.value = str; // Set its value to the string that you want copied | |
el.setAttribute('readonly', ''); // Make it readonly to be tamper-proof | |
el.style.position = 'absolute'; | |
el.style.left = '-9999px'; // Move outside the screen to make it invisible | |
document.body.appendChild(el); // Append the <textarea> element to the HTML document | |
const selected = | |
document.getSelection().rangeCount > 0 // Check if there is any content selected previously | |
? document.getSelection().getRangeAt(0) // Store selection if found |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm