Skip to content

Instantly share code, notes, and snippets.

View KenAniarDev's full-sized avatar
🎯
Focusing

Nestor Kenneth Tesorio Aniar KenAniarDev

🎯
Focusing
View GitHub Profile
@KenAniarDev
KenAniarDev / clean_code.md
Created February 23, 2024 05:49 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@KenAniarDev
KenAniarDev / GitCommitBestPractices.md
Created February 5, 2024 03:18 — forked from luismts/GitCommitBestPractices.md
Git Tips and Git Commit Best Practices

Git Commit Best Practices

Basic Rules

Commit Related Changes

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other developers to understand the changes and roll them back if something went wrong. With tools like the staging area and the ability to stage only parts of a file, Git makes it easy to create very granular commits.

Commit Often

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having large commits and sharing them infrequently, in contrast, makes it hard to solve conflicts.

@KenAniarDev
KenAniarDev / README.md
Created March 16, 2022 04:20 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

Download This sample on Google Play Store

@KenAniarDev
KenAniarDev / MultiSelect.js
Created March 9, 2022 15:51 — forked from landorid/MultiSelect.js
MultiSelect with Tailwind, headlessui
import PropTypes from "prop-types";
import { useState, useRef, useEffect, forwardRef } from "react";
import { Listbox, Transition } from "@headlessui/react";
function MultiSelect({ options, label, selected, onChange }) {
const node = useRef();
const [isOpen, setIsOpen] = useState(false);
useEffect(() => {
document.addEventListener("mousedown", handleClick);
@KenAniarDev
KenAniarDev / node_nginx_ssl.md
Created February 2, 2022 03:29 — 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

@KenAniarDev
KenAniarDev / countries.json
Created November 24, 2021 07:04 — forked from keeguon/countries.json
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},