Skip to content

Instantly share code, notes, and snippets.

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

Afrie Irham afrieirham

🏠
Working from home
View GitHub Profile
export const isValidUrl = (url: string) => {
try {
new URL(url);
return true;
} catch {
return false;
}
};
  1. Learn programming basics
  2. Learn how to build static website using HTML & CSS
  3. Learn how to make a dynamic website using JavaScript (to-do list app, contacts app)
    • Learn JavaScript framework
    • Learn Git & GitHub
  4. Learn SQL database
  5. Learn how to build an API (node.js)
    • Learn how internet works
    • Learn REST API
  • Learn HTTP protocol
@afrieirham
afrieirham / commits.md
Created August 22, 2022 14:55
Git commit message format

Format:

<type>[optional module scope]: <description>

Example:

feat (auth): add facebook login
#include <Keypad.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(13, 12, 11, 10, A0, A1);
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
@afrieirham
afrieirham / git.md
Last active April 30, 2021 04:02
Git guide

Remove git remote reference

  • git remote rm <destination>

If something went wrong

Use these commands if you made any mistakes. Accidental commits, wrong git message (or typo).

Update previous git message (or typo)

  • git commit --amend or
  • git commit --amend -m "New git message"
@afrieirham
afrieirham / conprog_lab_1.java
Created March 9, 2020 09:19
Concurrent Programming Lab 1
package conprog_lab_1;
public class ConProg_Lab_1 {
public static void main(String[] args) {
PrintChar pc1 = new PrintChar('A', 10);
PrintChar pc2 = new PrintChar('B', 10);
PrintNum pn = new PrintNum(10);
@afrieirham
afrieirham / index.js
Created May 21, 2019 16:09
Digi-X Section 2
// Question 1
var i=0;
var mulArr = [];
while(i<=100){
if(i%3 == 0 || i%5 == 0){
mulArr.push(i)
}
i++;
}
@afrieirham
afrieirham / answer.js
Created February 9, 2019 13:05
Basic JavaScript: Profile Lookup #FCC
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
@afrieirham
afrieirham / answer.js
Created February 9, 2019 08:36
Basic JavaScript: Testing Objects for Properties #FCC
// Setup
var myObj = {
gift: "pony",
pet: "kitten",
bed: "sleigh"
};
function checkObj(checkProp) {
//Check if the Object has that property, not check the value.
@afrieirham
afrieirham / answer.js
Last active February 9, 2019 08:25
Basic JavaScript: Using Objects for Lookups #FCC
// Setup
function phoneticLookup(val) {
var result = "";
let lookup = {
alpha: 'Adams',
bravo: 'Boston',
charlie: 'Chicago',
delta: 'Denver',
echo: 'Easy',