Skip to content

Instantly share code, notes, and snippets.

View robzolkos's full-sized avatar
📈
Building products

Rob Zolkos robzolkos

📈
Building products
View GitHub Profile
# CLI
sudo apt update && apt install \
git curl docker.io \
build-essential pkg-config autoconf bison rustc cargo clang \
libssl-dev libreadline-dev zlib1g-dev libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev libjemalloc2 \
libvips imagemagick libmagickwand-dev libsqlite3-0 \
redis-server mysql-server sqlite3 libmysqlclient-dev apache2-utils \
rbenv
# UI apps
@robzolkos
robzolkos / ci.yml
Created November 20, 2023 19:21
Github Action for CI for Rails app
name: CI
on:
pull_request:
branches:
- master
env:
RAILS_ENV: test
REDIS_URL: redis://redis:6379/1
@robzolkos
robzolkos / kamal.txt
Created September 27, 2023 00:14
kamal log
d622b2a6e45b# git ci
[main 9fd846e] Move github icon
1 file changed, 6 insertions(+), 6 deletions(-)
d622b2a6e45b# bundle exec kamal deploy
INFO [6f51ddc7] Running /usr/bin/env mkdir -p .kamal on 137.184.192.228
INFO [6f51ddc7] Finished in 2.554 seconds with exit status 0 (successful).
Acquiring the deploy lock...
Log into image registry...
INFO [4cbcab2b] Running docker login registry.digitalocean.com -u [REDACTED] -p [REDACTED] as root@localhost
INFO [4cbcab2b] Finished in 1.282 seconds with exit status 0 (successful).
@robzolkos
robzolkos / issue.md
Last active April 12, 2024 14:15
kamal deploy error
  1. create new droplet, make sure domain points to it.
  2. clone repo https://github.com/robzolkos/turbonativedirectory
  3. bundle exec kamal setup

At this point the application is deployed and working

  1. Update a css class/change some text on placeholder home page
  2. commmit
  3. bundle exec kamal deploy
@robzolkos
robzolkos / Dockerfile
Last active March 2, 2024 20:59
Kamal / SQLite3 issue
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.2
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
# Rails app lives here
WORKDIR /rails
# Set production environment
@robzolkos
robzolkos / downloaded_photo.rb
Last active September 18, 2023 17:52
Jump zip download refactor from service object
# app/models/jump/downloaded_photo.rb
class Jump::DownloadedPhoto
include ActiveModel::API
attr_accessor :file_name, :file_path
end
@robzolkos
robzolkos / stories.rb
Last active September 8, 2023 21:37
story.rb refactor
# Original code https://twitter.com/robinbortlik/status/1699524286568964440?s=20
# app/controllers/stories.rb
class StoriesController < ApplicationController
before_action :check_authorizationa # this should check and return a 401
def create
story = Story.new(story_params)
if story.save
@robzolkos
robzolkos / curl.sh
Last active October 15, 2020 14:55
nginx action cable error
curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: portal.example.com.au" -H "Origin: https://portal.example.com.au" https://portal.example.com.au/cable
HTTP/1.1 301 Moved Permanently
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 15 Oct 2020 14:33:10 GMT
Content-Type: text/html
Transfer-Encoding: chunked
Connection: keep-alive
Location: https://portal.example.com.au/cable
@robzolkos
robzolkos / Gemfile
Created June 25, 2020 12:25 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@robzolkos
robzolkos / anchor_test.html
Created March 16, 2020 19:35
Anchor Test
<html>
<body>
<a href=“#test”>Test</a>
<br />
<br />
<br />
<br />
<br />
<br />