Skip to content

Instantly share code, notes, and snippets.

View acushlakoncept's full-sized avatar
🎯
Focusing

Uduak Essien acushlakoncept

🎯
Focusing
View GitHub Profile
@acushlakoncept
acushlakoncept / .htaccess
Created February 4, 2025 16:47
CPanel .htaccess for react js
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]

Source deployment_aws_capistrano

Setup EC2 instance with Ruby and RVM

Step by step instructions to setup your EC2 server for deploying a Rails application. Reference here

  • Login to your EC2 instance
 ubuntu@ip-172-30-0-195:~$ pwd
import React, { Component } from "react";
import {
deepEquals,
getDefaultFormState
} from "@rjsf/core/lib/utils";
import PropTypes from "prop-types";
export function getFieldName(name) {
const DEFAULT_COMPONENT_TYPES = {
# Why do we need KudeURI? Because the URI.join method doing something stupid:
#
# URI.join('http://example.com/subpath', 'hello', '?token=secret')
# => “http://example.com/hello?token=secret”
#
# But what I expected is “http://example.com/subpath/hello?token=secret", the subpath is gone.
# By using SmartURI, you can handle the case above gracefully:
#
# SmartURI.join('http://example.com/subpath', 'hello', query: { token: secret })
# => "http://example.com/subpath/hello?token=secret"
@acushlakoncept
acushlakoncept / youtube-video-commands
Created May 31, 2022 10:22 — forked from ThomasBush/youtube-video-commands
Ubuntu 20.04 Focal Fossa Rails server setup
# Generate Random Passwords
curl 'https://www.random.org/passwords/?num=2&len=24&format=plain&rnd=new'
# Create deploy user
sudo adduser deploy
sudo adduser deploy sudo
su deploy
cd ../deploy/
# Generate ssh keys 
const fs = require('fs');
const dic = fs.readFileSync('example.in', 'utf8');
const lines = dic.split('\n');
let output = [];
const testCases = lines.shift() * 1;
let caseLength = [];
let counter = 0;
let linesObj = {};
let lineNum = 0;
# USING SENDGRID
# create your apikey, you will use it as the password
# add gem 'dotenv-rails'
# create .env in the root directory and remember to add it to .gitignore
# Add SENDGRID_PASSWORD=SG.xxxxxxx to .env where "SG.xxxxxxx" is the APIKEY you generated
#First configure Devise email in config/initializers/devise.rb:
# Verify the email as single sender at https://app.sendgrid.com/settings/sender_auth
config.mailer_sender = "[email protected]"
@acushlakoncept
acushlakoncept / brew.md
Last active September 22, 2021 08:31
MacOS Brew Installation

Deploy Ruby on Rails into an AWS EC2 Instance

# Connect to your instance from your terminal
ssh -i /path_to_the_file/file_name.pem ubuntu@ip # Public IP From EC2 Instance
# When running this after the first download, it will through an error
# It will say that this instance isn't secure, for that will run
# The following cmd
chmod 400 /Downloads/example-key-1.pem
# Because the Pen file doesn't have the right permission to execute it
@acushlakoncept
acushlakoncept / factorial-DP.js
Last active September 22, 2021 08:32
Finding factorial using Dynamic Programming
const factorial = (n) => {
let memo = []
memo[0] = 1
for(let i = 1; i <= n; i++) {
memo[i] = i * memo[i - 1];
}
return memo[n]
}