Skip to content

Instantly share code, notes, and snippets.

View SunDi3yansyah's full-sized avatar

Cahyadi Triyansyah SunDi3yansyah

View GitHub Profile
ShvaykaD /
Created May 4, 2020 16:29
Upgrading PostgreSQL service from 9.x or 10.x to 11 version on CentOS 7
jesster2k10 /
Last active July 11, 2024 08:48
JWT Auth + Refresh Tokens in Rails

JWT Auth + Refresh Tokens in Rails

This is just some code I recently used in my development application in order to add token-based authentication for my api-only rails app. The api-client was to be consumed by a mobile application, so I needed an authentication solution that would keep the user logged in indefinetly and the only way to do this was either using refresh tokens or sliding sessions.

I also needed a way to both blacklist and whitelist tokens based on a unique identifier (jti)

Before trying it out DIY, I considered using:

OrionUnix / Sublime Text 3.2.2 Build 3211 key licence
Last active June 26, 2024 01:41
Sublime Text 3.2.2 Build 3211 key licence
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
ArturT / main.yaml
Last active November 9, 2022 06:10
GitHub Actions - how to run parallel tests in RSpec for Ruby on Rails project. See article how to run RSpec on GitHub Actions for Ruby on Rails app using parallel jobs or sign up at…
# .github/workflows/main.yaml
name: Main
on: [push]
runs-on: ubuntu-latest
# If you need DB like PostgreSQL, Redis then define service below.
SunDi3yansyah /
Last active August 18, 2019 04:42
Rails Indonesia Installation with RVM |

Instalasi Ruby dan Rails

SunDi3yansyah /
Last active November 29, 2018 17:51
Find Gems on Repository with Scraping

Find Gems on Repository with Scraping

Get Gems from Local

~/ruby via 💎 v2.5.3 
➜ gem list --no-versions

then put in array gems.rb

SunDi3yansyah /
Last active September 8, 2023 15:10
Cara Install Secure Nginx dengan Let's Encrypt di CentOS 7

Step 1 — Installing the Certbot Let's Encrypt Client

sudo yum install epel-release
sudo yum install certbot-nginx

Step 2 — Setting up Nginx

sudo yum install nginx
SunDi3yansyah /
Last active June 25, 2019 12:34
Git Hooks

Git Hooks

On server for git hook

mkdir /git
cd /git
mkdir repository/app.git -p
cd repository/app.git
git init --bare
cd hooks
SunDi3yansyah / exception_handler.rb
Last active April 30, 2019 18:10
Exception Handler in Rails =>
module ExceptionHandler
extend ActiveSupport::Concern
included do
rescue_from ActionController::Base,
# ActionController::Middleware,
maxivak /
Last active June 15, 2024 21:37
Webpack, Yarn, Npm in Rails