Skip to content

Instantly share code, notes, and snippets.

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

Nana Adjei Manu claeusdev

🏠
Working from home
View GitHub Profile
@claeusdev
claeusdev / rails http status codes
Created October 31, 2023 18:20 — 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
@claeusdev
claeusdev / design.md
Created September 5, 2023 21:56
Simple design for Writtr

Overview

This is a design template for a very simple multiblogging application. Saas with payments, newsletters, subscriptions.

MVP Scope

Basic functionality:

 1. User can sign up/sign in 
@claeusdev
claeusdev / index.md
Last active June 14, 2023 23:34
Assignment for better javascript/Typescript/React.

Assignment 1

We want to get/have access to all values stored in browser storage. Implement (complete) the hook below such that it meets the acceptance criteria. We want to have the ability to read, add and update values from the browser storage when the hook is called. Think about all the CRUD actions for each object returned from the useBrowserStorage() hook.

IMPLEMENATION NOTES

  1. for. v1 can be as poor as possible because we shall review and work on refactoring
  2. v2 consider better state management ( context, stateHooks, reducers )
Grid
Flex -
Transitions/Animations -
boxShadow: {
}
const Text {
@claeusdev
claeusdev / .zshrc
Created September 2, 2022 15:18 — forked from jednano/.zshrc
export PATH="$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"
export PATH="/usr/local/opt/python/bin:$PATH"
export GPG_TTY=$(tty)
# export START="$HOME/a"
# if [[ $PWD == $HOME ]]; then
# cd $START
# fi
# alias ls='ls -F --color --show-control-chars'
@claeusdev
claeusdev / ruby_books.md
Created June 30, 2022 16:29 — forked from baweaver/ruby_books.md
A list of books for learning and expanding on your Ruby knowledge.

Ruby Book List

Learning Ruby

You're taking your first steps into Ruby

A good introduction to programming in general. Easy on newer programmers.

Getting Started

After download of this repository you may want to install the dependencies by running: yarn or yarn install. Some other commands available to you as as follows:

  • After running yarn or yarn install, i recommend yarn because why would you want to type so much?
  • Run yarn start to start webpack and run the devserver.
  • Open your browser and navigate to http://localhost:7740, this is the default, if you intend to change this port because you have something else running on that port. You can change the port variable under ./internals/webpack/utils.ts.
  • Inside yout browser you should see a very moderately nice application.
def generate_anagrams(word)
  dict = Hash.new {|hash, key| hash[key] = []}
  sorted_word = get_sorted_word(word)
  File.readlines("/usr/share/dict/words").each do |found_word|
    anagram = get_sorted_word(word.chomp) 
    dict[anagram] << found_word
 end
class PostController < ApplicationController
before_action :set_post
before_action :set_active_posts, only: [:create, :update]
def show
@post = @posts.find_by(slug: params[:slug])
@author = @post.author
if !@post.present?
render "errors/404.html", status: :not_found
class Admin::AdminPostsController < InheritedResources::Base
layout 'admin'
before_filter :require_login
before_action :set_post
before_action :set_branches
before_action :set_sections
load_and_authorize_resource
def index