A comprehensive reference for Omarchy - an opinionated Arch Linux + Hyprland setup by DHH.
| Shortcut | Function |
|---|
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ sudo docker volume rm $(sudo docker volume ls -qf dangling=true)
$ sudo docker volume ls -qf dangling=true | xargs -r sudo docker volume rm
| class Enterprisifier | |
| def self.enterprisify! | |
| sleep 5 | |
| end | |
| end |
| FROM alpine:3.2 | |
| ENV GOROOT=/usr/lib/go \ | |
| GOPATH=/gopath \ | |
| GOBIN=/gopath/bin \ | |
| PATH=$PATH:$GOROOT/bin:$GOPATH/bin | |
| WORKDIR /gopath/src/app | |
| ADD . /gopath/src/app |
| FROM google/golang:stable | |
| # Godep for vendoring | |
| RUN go get github.com/tools/godep | |
| # Recompile the standard library without CGO | |
| RUN CGO_ENABLED=0 go install -a std | |
| MAINTAINER [email protected] | |
| ENV APP_DIR $GOPATH/Users/mati/deindeal/moosehead/modules/newsletter_feeds | |
| # Set the entrypoint |
| Review finished - expecting dev input | |
| Feedback considered - expecting review | |
| Code accepted - Ready for QA | |
| QA pending | |
| QA validated | |
| QA rejected - expecting dev input | |
| Ship it |
| YourApplication::Application.routes.draw do | |
| root to: 'home#index' | |
| get '/about' | |
| get '/login' => 'application#login' | |
| end | |
| ADDITIONAL_ROUTES = [:messages, :orders, :api, :admin] | |
| ADDITIONAL_ROUTES.each do |route_file| | |
| require "#{Rails.root}/config/routes/#{route_file}" | |
| end |
| # Currently, many times we are using ENV variables in a non-optimal way. | |
| # I'd like to explain some of the common use cases for those variables | |
| # and how we can use them in a way that we get the most out of it. | |
| # A common error is to assume that the variable has to be there, but it isn't | |
| # This happens when we use the ENV hash like this: | |
| ENV['SOME_KEY'] | |
| # In Ruby, if the key is missing, it will return `nil`, thus calling a method on it |
| class MemoryCache | |
| DEFAULT_MAX_KEYS = 5000 | |
| attr_reader :data, :max_keys | |
| def initialize(config) | |
| @data = {} | |
| @max_keys = config[:max_cache_keys] || DEFAULT_MAX_KEYS | |
| @lock = Mutex.new |