Skip to content

Instantly share code, notes, and snippets.

View radavis's full-sized avatar

Richard Davis radavis

View GitHub Profile
@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
# OS-Installed Font Stacks
https://codepen.io/brianhaferkamp/pen/BLdgjk
```
Serif Fonts
Georgia, serif
'Palatino Linotype', 'Book Antiqua', Palatino, serif
'Times New Roman', Times, serif
@radavis
radavis / .rails_aliases
Last active January 23, 2021 22:34
.rails_aliases
export EDITOR=subl
export PGHOST=127.0.0.1
#export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
function rails_new() { rails new $1 && cd $1 && git init && git add . && git commit -m 'Initial commit'; }
alias migrate='rake db:migrate && rake db:rollback && rake db:migrate'