Skip to content

Instantly share code, notes, and snippets.

View frizbee's full-sized avatar
🎯
Focusing

Andre frizbee

🎯
Focusing
View GitHub Profile

Starting with Puma 6.0, the --daemon flag has been removed for security reasons. Puma no longer supports daemonizing itself directly. If you need to run Puma in the background as a service, you should use a process manager like systemd, Upstart, or foreman, instead of using --daemon.

Use a Process Manager (systemd)

Instead of using Puma’s built-in daemon mode, you can manage it with a process manager like systemd. Here’s an example of how you can set up Puma with systemd:

Create a systemd service file

Create a file called /etc/systemd/system/puma.service with the following content (replace paths with your specific setup):

[Unit]
@frizbee
frizbee / create_erlang_project.md
Last active July 3, 2024 14:35
Script that will create the folder and file structure for your Erlang application and populate it with the example files

Create simple Erlang project structure

Folder structure

my_server/
├── _build/
├── config/
│   └── sys.config
├── deps/
├── ebin/
├── include/
@frizbee
frizbee / summernote-with-image-attributes.md
Last active September 20, 2023 09:47
Summernote for Rails 6 using webpacker with Image title and alt attributes

Summernote editor for Rails 6 with webpacker and image attributes

WYSIWYG editor for website is summernote https://summernote.org

Setup

Summernote setup with webapcker, using yarn add command

yarn add summernote@0.8.16
brew update
brew upgrade
rbenv install -l
# will list all latest ruby versions
# if it will not show all latest versions
# then run:
cd ~/.rbenv/plugins/ruby-build/ && git pull
# list all versions again
@frizbee
frizbee / readme.md
Created June 26, 2021 19:47 — forked from maxivak/readme.md
sitemap.xml for Rails 4 application

Generate sitemap.xml in Rails app

This post shows how to make sitemap.xml for your web site. The sitemap will be accessible by URL http://mysite.com/sitemap.xml

Routes

Myrails::Application.routes.draw do
@frizbee
frizbee / ubuntu-20.04.sh
Created July 21, 2020 12:45
Ubuntu Desktop 20.04
#!/bin/bash
# This config file is for desktop version of Ubuntu
# Default settings
start=`date +%s`
bold=$(tput bold)
normal=$(tput sgr0)
red=`tput setaf 1`
green=`tput setaf 2`
@frizbee
frizbee / centos7.setup.sh
Last active July 9, 2020 07:14
setup dev env for centos7
#!/bin/bash
# Default settings
start=`date +%s`
bold=$(tput bold)
normal=$(tput sgr0)
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
VIMREPO="https://gist.githubusercontent.com/frizbee/8174f50d6863666efb217615bc1ecfac/raw/42db6ec0527de01e1215ca29689ea7ef10b7d51d/vimrc"
@frizbee
frizbee / install-ruby.sh
Last active November 12, 2022 05:51 — forked from hopsoft/install-ruby.sh
Install ruby with rbenv and jemalloc on ubuntu
sudo apt-get update
sudo apt-get install libjemalloc-dev
RUBY_CONFIGURE_OPTS='--with-jemalloc' rbenv install 2.7.1
rbenv global 2.7.1
# test (look for jemalloc warnings)
MALLOC_CONF=invalid_flag:foo ruby -v
# check
ruby -r rbconfig -e "puts RbConfig::CONFIG['MAINLIBS']"
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@frizbee
frizbee / vimrc
Last active July 24, 2020 03:11
my current .vimrc
syntax on
set hidden
set noerrorbells
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set nu
set nowrap