Skip to content

Instantly share code, notes, and snippets.

View jonahgeek's full-sized avatar
🏠
Too Mobile

Jonathan Mwebaze jonahgeek

🏠
Too Mobile
View GitHub Profile
@jonahgeek
jonahgeek / install laravel on ubuntu 20.04.md
Last active April 26, 2023 03:52
Install Laravel on Ubuntu 20.04

Step 1

Open terminal and type

$ sudo apt update

Step 2

Install apache web server

@jonahgeek
jonahgeek / image upload.js
Created October 14, 2021 07:53
Handling image upload in react
const handleImageUpload = async (e) => {
// get the file name
const file = e.target.files[0];
// attach file
const bodyFormData = new FormData();
bodyFormData.append("image", file);
// set fieldValue state
@jonahgeek
jonahgeek / brew install and brew update hang with error.md
Created March 24, 2022 09:28
brew install and brew update hang with error: 'refs/remotes/origin/master': unknown revision or path not in the working tree.

What are you were trying to do?

A fresh install of homebrew on OSX, or any other brew installation;

What happened?

Installation hangs with the error:

error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git  [...] -- [...]'
@jonahgeek
jonahgeek / uploading files and serve directory listing using nodejs.md
Last active August 16, 2022 13:41
Uploading files and serve Directory Listing Using NodeJS

On your base app directory, create a folder as such:

mkdir -p public/uploads

Install multer in order to handle multipart/form-data

npm i multer

Import multer before you can use it

@jonahgeek
jonahgeek / install-tailwind-elements.md
Created February 14, 2023 07:38
Install tailwind elements
  1. Run the following command to install the package;

npm install tw-elements

  1. Tailwind Elements is a plugin and should be included inside the tailwind.config.js file
@jonahgeek
jonahgeek / Install-laravel-on-windows.md
Created April 25, 2023 06:13
Installing latest version of laravel on windows
  1. Download and install Xampp (You can follow this direct link 👉 XAMPP DIrECt DOWNLOAD)

  2. Download and Install Composer Download Composer LTS
    You might need to restart your computer after installing composer.

  3. Download and Install Laravel using the command below which will install the latest version of Laravel on your system.

    composer global require laravel/installer
    

To create a simple to-do list app on Slack, you can use Slack's built-in features and combine them with custom slash commands and a dedicated channel for task management. Here's a step-by-step guide:

  1. Create a dedicated channel: Start by creating a channel specifically for your to-do list. You can name it something like "#todo-list" or any other name that suits your preference.

  2. Enable custom slash commands: In your Slack workspace, go to the "Settings & administration" section, then select "Manage apps." Look for "Custom Integrations" and click on "Slash Commands." Create a new command, like "/todo", and configure it to point to the endpoint where you'll handle the command's logic.

  3. Set up a backend server: You'll need a server to handle the slash command requests and store the to-do list data. You can use any server-side technology you're comfortable with, such as Node.js, Python, or Ruby.

  4. Implement the slash command logic: In your backend server, listen for incoming requests from Slack for the

@jonahgeek
jonahgeek / Create a Node.js API Error Webhook.md
Last active September 30, 2023 18:04
Create a nodeJS API that's a webhook that saves errors to a database

Step 1: Set up the project

  • Create a new directory for your project.
  • Open a terminal, navigate to the project directory, and run the following command to initialize a new Node.js project:
    npm init -y
    

Step 2: Install dependencies

  • Install the required dependencies by running the following commands:
@jonahgeek
jonahgeek / configure-new-vps.md
Created July 7, 2023 07:26
Configure New VPS

Congratulations on your new VPS server running Ubuntu! Here are some essential steps you should take to set up your server:

  1. Update the system: Begin by updating the package repositories and upgrading all the installed packages on your server. This ensures that you have the latest security patches and bug fixes. Run the following commands:

    sudo apt update
    sudo apt upgrade
    
  2. Secure your server: Strengthen the security of your VPS by configuring the firewall and enabling only necessary network services. Ubuntu uses UFW (Uncomplicated Firewall) as a front-end to manage firewall rules. To enable UFW and allow SSH access, execute the following commands:

@jonahgeek
jonahgeek / getting-started-with-git.md
Created September 25, 2023 03:20
Getting started with git and github

Getting Started with Git and GitHub

Git is a powerful distributed version control system that allows you to track changes in your code and collaborate with others. GitHub is a popular platform for hosting and sharing Git repositories. This guide will help you get started with Git and GitHub.

Prerequisites

  1. Install Git: If you haven't already, download and install Git for your operating system.

  2. Create a GitHub Account: If you don't have a GitHub account, sign up for one.