Skip to content

Instantly share code, notes, and snippets.

View EfeAgare's full-sized avatar
🎯
Focusing

Efe Agare EfeAgare

🎯
Focusing
View GitHub Profile
@EfeAgare
EfeAgare / Ruby and Rails Study Roadmap.md
Created November 30, 2022 07:59 — forked from onlurking/Ruby and Rails Study Roadmap.md
Ruby and Rails Study Roadmap
@EfeAgare
EfeAgare / LICENSE
Created October 19, 2022 10:30 — forked from sinisterchipmunk/LICENSE
tar, gzip, and untar files using ruby in memory without tempfiles
Copyright (C) 2011 by Colin MacKenzie IV
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@EfeAgare
EfeAgare / composition.rb
Created August 2, 2022 14:57
Composition_over_inheritance
## We try to seperate out the concept andcombine them in meaning ways
##
## 1) Employee with employee data
## 2) Employee payment structure (hourly, salaried, freelancer)
## 3) Commission based on the number of contract
##
# 1
### break down again
class Commission
@EfeAgare
EfeAgare / rails http status codes
Created July 27, 2022 10:11 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
@EfeAgare
EfeAgare / Rails_graphql.md
Last active July 22, 2022 15:14
rails_graphql_image_or_file_upload_on_postman

Convert this

Screenshot 2022-07-22 at 16 04 41

to this

@EfeAgare
EfeAgare / update_book_spec.rb
Created April 21, 2022 12:59 — forked from kayinrage/update_book_spec.rb
Testing GraphQL Mutations In Ruby On Rails with Rspec
require 'rails_helper'
module Mutations
module Books
RSpec.describe UpdateBook, type: :request do
describe 'resolve' do
it 'updates a book' do
book = create(:book, title: 'Hero', publication_date: 1984, genre: 'Horror')
author = create(:author)
@EfeAgare
EfeAgare / csv_importable.rb
Created March 13, 2022 20:21 — forked from jeff-free/csv_importable.rb
Rspec CSV import feature testing with CSV foreach stubbing
# Implementation
module CSVImportable
extend ActiveSupport::Concern
included do
def self.import(file)
CSV.foreach(file.path, headers: true, encoding:'utf-8') do |row|
self.create! row.to_hash
end
@EfeAgare
EfeAgare / puma.service
Created February 8, 2022 15:11 — forked from arteezy/puma.service
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@EfeAgare
EfeAgare / LifecycleEventLIstener.java
Created January 30, 2022 21:56 — forked from christocracy/LifecycleEventLIstener.java
Listening to React-Native life-cycle events in your custom Views or Modules
public class MyView extends SimpleViewManager<MapView> {
public static final String TAG = "MyView";
@Override
public String getName() {
return TAG;
}
@Override
protected MapView createViewInstance(ThemedReactContext context) {
@EfeAgare
EfeAgare / node_nginx_ssl.md
Created December 3, 2021 21:59 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user