A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
The purpose of this time is to explore OpenFaaS and to relate it to the team's existing skills around the Ruby eco-system. We will be using OpenFaaS with Kubernetes (k3s).
This workshop is available to the public under the MIT license. Anyone can follow along.
initialize
: once, when the controller is first instantiatedconnect
: anytime the controller is connected to the DOMThis small guide should help you get setup with rclone v1.40 to read/write directly to a cache
mount and have Plex get notified of new tv/movies that get added to the mount by Radarr/Sonarr
/mnt/user/media:/media
for all 3. If not, the auto-scan will likely not work properly.# Add to the given file the given lines, after the line with the given text, or replace the content | |
def add_to_file(path, text, after=nil, replace=false) | |
lines = [] | |
if replace | |
lines = text | |
else | |
File.readlines(path).each do |line| | |
if after != nil and line.include?(after) | |
lines << line | |
lines << text |
--database=mysql | |
--skip-coffee | |
--skip-turbolinks | |
--template=~/.rails-template.rb |
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |
#!/bin/bash | |
# Tom Hale, 2016. MIT Licence. | |
# Print out 256 colours, with each number printed in its corresponding colour | |
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163 | |
set -eu # Fail on errors or undeclared variables | |
printable_colours=256 |
# theory - https://eleanormaclure.files.wordpress.com/2011/03/colour-coding.pdf (page 5) | |
# kelly's colors - https://i.kinja-img.com/gawker-media/image/upload/1015680494325093012.JPG | |
# hex values - http://hackerspace.kinja.com/iscc-nbs-number-hex-r-g-b-263-f2f3f4-242-243-244-267-22-1665795040 | |
kelly_colors = ['F2F3F4', '222222', 'F3C300', '875692', 'F38400', 'A1CAF1', 'BE0032', 'C2B280', '848482', '008856', 'E68FAC', '0067A5', 'F99379', '604E97', 'F6A600', 'B3446C', 'DCD300', '882D17', '8DB600', '654522', 'E25822', '2B3D26'] |