Skip to content

Instantly share code, notes, and snippets.

View radavis's full-sized avatar

Richard Davis radavis

View GitHub Profile

Using the OS X Command Line

Directory Shortcuts

~ - Home Directory
. - Current Directory
.. - Enclosing Directory
/ - Root Directory
services:
redis:
image: redis:6.2-alpine
ports:
- "6379:6379"
postgres:
image: postgis/postgis:13-3.4-alpine
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-password}"
POSTGRES_USER: "${POSTGRES_USER:-postgres}"
@radavis
radavis / .railsrc
Last active March 22, 2024 16:42
Using .railsrc and a Rails Template
# ~/.railsrc
--database=postgresql
--skip-bundle
--skip-spring
--skip-test-unit
--skip-turbolinks
--template=/path/to/rails_template.rb
@radavis
radavis / Reposfile
Created June 8, 2023 16:43
Keep a list of repositories up-to-date, locally.
git@github.com:username/reponame.git
git@gitlab.com:username/another-repo.git
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Foundation CDN Starter Template</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/foundation/6.2.4/foundation.min.css">
</head>
<body>

Middleware

  • HTTP Request/Response Cycle
  • MVC

How does the application know how to map HTTP requests to Controller actions?

Rack::Middleware

Rails routes are a middleware that map the HTTP Verb and Path (within a HTTP request) to a Controller action.

@radavis
radavis / .env.example
Last active December 22, 2021 22:32
Self-hosted GitLab at gitlab.your-hostname.duckdns.org
PUID=1000 # id -u
PGID=1000 # id -g
EXTERNAL_HOSTNAME=your-hostname.duckdns.org
DUCKDNS_TOKEN="" # visit https://www.duckdns.org/ create an account, copy your token
EMAIL=your-email@somewhere.org
GITLAB_HOME=./gitlab
GITLAB_ROOT_PASSWORD=password
@radavis
radavis / tigervnc_start
Last active September 25, 2021 16:45
x11vnc/tigervnc helper scripts
#! /usr/bin/env bash
# apt install tigervnc-common tigervnc-scraping-server tigervnc-standalone-server tigervnc-xorg-extension
x0vncserver \
-display :0 \
-geometry 1024x768+1920+0 \
-passwordfile $HOME/.vnc/passwd
# stop
Windows Registry Editor Version 5.00
;swap caps-lock and escape keys in Windows
;from https://raerav.com/how-to-remap-the-capslock-and-escape-key-in-windows/
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,3a,00,01,00,01,00,3a,00,00,00,00,00

ubuntu 20.10 notes

problem: "initramfs unpacking failed: Decoding failed" in sudo dmesg --level=err,warn output

try:

$ sudo nano /etc/initramfs-tools/initramfs.conf
COMPRESS=gzip
$ sudo update-initramfs -u -k all