Skip to content

Instantly share code, notes, and snippets.

View omkz's full-sized avatar
🏠
Working from home

Kurnia Muhamad omkz

🏠
Working from home
View GitHub Profile
@omkz
omkz / episode_search.rb
Created September 1, 2023 12:58 — forked from ryanb/episode_search.rb
Class that handles the PostgreSQL full text search for railscasts.com
class EpisodeSearch
attr_reader :ability, :options
delegate :sanitize, to: Episode
def initialize(ability, options = {})
@ability = ability
@options = options.dup
end
def tag
@omkz
omkz / rails-skip.md
Created January 30, 2023 23:33 — forked from AshikNesin/rails-skip.md
Rails generator controller without tests, assets & helpers

Configuring application.rb

To turn off without having to add options:

# application.rb
config.generators.assets = false
config.generators.helper = false

While Generating Controller

https://us04web.zoom.us/j/75781826492?pwd=VybEkJbdwm0ZZNb8bj9epFs6DtduNd.1#success
@omkz
omkz / _thumbnail.html.erb
Created September 22, 2022 19:36 — forked from yshmarov/_thumbnail.html.erb
embed Youtube in ActionText
app/views/youtubes/_thumbnail.html.erb
<div>
<%= image_tag youtube.thumbnail_url, style: "max-width:400px" %>
</div>
@omkz
omkz / Instruction.md
Created August 10, 2022 00:31 — forked from Kaapiii/Instruction.md
Ubuntu 20.04/20.10 Install TLP for Lenovo ThinkPad

Installation Instruction for TLP for Lenovo ThinkPads

Install & Start TLP & Check System Status

sudo apt install tlp tlp-rdw
sudo tlp start
sudo tlp-stat -s

Check status of battery features with

@omkz
omkz / filterable.rb
Created May 5, 2022 01:04 — forked from justinweiss/filterable.rb
Filterable
# Call scopes directly from your URL params:
#
# @products = Product.filter(params.slice(:status, :location, :starts_with))
module Filterable
extend ActiveSupport::Concern
module ClassMethods
# Call the class methods with names based on the keys in <tt>filtering_params</tt>
# with their associated values. For example, "{ status: 'delayed' }" would call
@omkz
omkz / Fastboot_cmd.txt
Created February 27, 2022 11:21 — forked from michaeljymsgutierrez/Fastboot_cmd.txt
Fastboot command lines for android
1. Flashing the recovery image:
fastboot flash recovery recovery.img
2. Flash the kernel and bootloader:
fastboot flash boot boot.img
3. Erase a partition:
fastboot erase cache
@omkz
omkz / stimulus.md
Created January 1, 2022 16:26 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@omkz
omkz / ruby_on_rails_deployment.md
Created December 14, 2021 15:36 — forked from zentetsukenz/ruby_on_rails_deployment.md
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |