Skip to content

Instantly share code, notes, and snippets.

View imkikus's full-sized avatar
🤓
Focused

Kikus imkikus

🤓
Focused
View GitHub Profile
@imkikus
imkikus / rails_g.rb
Created February 11, 2021 10:22 — forked from awkale/rails_g.rb
rails generators #rails #cheatsheet
# Controller Plural
rails g controller Users index show
# Helper Plural
rails g helper Users
# Mailer Singular
rails g mailer UserMailer
# Migration Plural
Cursor Movment
h - move left
j - move down
k - move up
l - move right
w - jump by start of words (punctuation considered words)
W - jump by words (spaces separate words)
e - jump to end of words (punctuation considered words)
E - jump to end of words (no punctuation)
@imkikus
imkikus / encrypt_decrypt.rb
Created November 20, 2020 06:05 — forked from wteuber/encrypt_decrypt.rb
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end
@imkikus
imkikus / encrypt_decrypt.rb
Created November 20, 2020 06:05 — forked from wteuber/encrypt_decrypt.rb
Simply encrypt and decrypt Strings in Ruby.
require 'openssl'
class String
def encrypt(key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(self) + cipher.final
s.unpack('H*')[0].upcase
end
@imkikus
imkikus / steps.md
Created March 9, 2020 10:01 — forked from dwayne/steps.md
How to install Ruby on Rails + MySQL + Apache with Passenger on Ubuntu

Introduction

This guide currently uses Ruby 1.9.3, Rails 3.2 and Ubuntu 13.04 (Raring Ringtail). I started off with a fresh install of Ubuntu on a virtual machine.

Step 1: Install Ruby

  1. Install RVM. See http://rvm.io/rvm/install for all the details.

     $ sudo apt-get install curl
    

$ \curl -L https://get.rvm.io | bash -s stable

### DigitalOcean Ubuntu 18.04 x64 + Rails 5 + Nginx + Unicorn + PostgreSQL9.6 + Capistrano 3
SSH into Root
$ ssh root@123.123.123.123
Change Root Password
$ passwd
@imkikus
imkikus / readme.md
Created March 2, 2017 09:46 — 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
@imkikus
imkikus / readme.md
Created March 2, 2017 09:46 — 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