Skip to content

Instantly share code, notes, and snippets.

@sebyx07
sebyx07 / ruby-3.3.0.sh
Last active July 2, 2024 14:13
Install ruby 3.3.0 with jemalloc, yjit from rbenv ubuntu 22.04
sudo apt update
sudo apt install libjemalloc-dev libffi-dev libpq-dev libz-dev libyaml-dev -y
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'eval "$(~/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc
# new terminal
@sebyx07
sebyx07 / search.js
Last active October 13, 2023 13:37
Example of search in electron.js. Only mark.js as dependency
import Mark from 'mark.js';
document.addEventListener('DOMContentLoaded', () => {
// only run in electron
if (!window.navigator.userAgent.toLowerCase().includes('electron')) return
let inputOpened = false;
let markedElements = [];
let currentMarkedElIndex = 0;
let markedEl;
@sebyx07
sebyx07 / heroku alternative.md
Created August 26, 2022 20:58
Heroku alternative

Best heroku alternative for rails applications

Hatchbox is also much cheaper

@sebyx07
sebyx07 / silence.md
Last active November 8, 2021 09:20
Silence all logs from active storage ActiveStorage::DiskController

Steps

Install lograge gem

inside config/application.rb

  config.lograge.enabled = true
  config.lograge.ignore_actions = %w[ActiveStorage::DiskController#show ActiveStorage::RepresentationsController#show]
module ChatApp
VERSION = "1" # String
class User
attr_reader :login, :email, :friends # String, String, Array[User | Bot]
def initialize(login, email) # String, String -> void
@login = login
@email = email
end
@sebyx07
sebyx07 / description.sh
Created February 24, 2021 19:14
hatchbox restore postgres db
# cd into the backup
tar -xvf DATABASE.tar
cd DATABASE/databases
gunzip -k PostgreSQL.sql.gz
psql DATABASE_URL < Postgresql.sql
echo "$USER ALL=(ALL:ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/$USER
@sebyx07
sebyx07 / app.md
Last active August 26, 2020 09:09
Cb radio app

Best CB radio 2020

Gigacb is the new futuristic and feature cb radio app for truck drivers

get it here for free cb

IOS to download ios cb

Android to download for android cb

@sebyx07
sebyx07 / info.md
Last active June 18, 2020 15:24
Vps deals
@sebyx07
sebyx07 / hatchbox.md
Last active June 18, 2020 09:12
Hatchbox.io code

Deploy ruby on rails application on aws ec2

For the last 2years I've been developing and deploying professionally, tens of Ruby on Rails application using Hatchbox.io .

Hatchbox has great support for cloud providers such as AWS, Digital Ocean and custom VPS.

Before using Hatchbox, I used Heroku and the features are similiar at one fraction of a cost.

Automatic deployments, NGINX, Let's Encrypt

You can also choose which database you want to use, such as Postgresql, Mysql, Mongodb.