Skip to content

Instantly share code, notes, and snippets.

View rahmatrhd's full-sized avatar

Rahmat Hidayat rahmatrhd

  • Jakarta, Indonesia
  • 01:30 (UTC +07:00)
View GitHub Profile
@rahmatrhd
rahmatrhd / karabiner.json
Created June 28, 2020 06:10
karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@rahmatrhd
rahmatrhd / Link.tsx
Created May 7, 2020 19:14
Using material-ui Link with next.js Link
@rahmatrhd
rahmatrhd / managing-multiple-git-accounts.md
Created July 8, 2019 09:29
Managing multiple git accounts

Copy and pasted from: https://mherman.org/blog/managing-multiple-github-accounts/

Managing Multiple Git Accounts

Let’s look at how to manage multiple Github accounts from one computer. In essence, it’s simply a matter of balancing both your git and ssh configurations - which actually is not as bad as it might seem.

Note: This tutorial is meant for Unix users.

Set up SSH Keys

Set up mysql (v8.0.16)

  1. Install mysql
  2. Run mysql service
  3. mysql -u root -p
  4. create user 'username'@'localhost' identified by 'password';
  5. grant all privileges on *.* to 'username'@'localhost';
  6. \q exit
  7. mysql -u username -p
  8. create database db_name;
// map
var animals = ['ayam', 'sapi', 'bebek']
function digoreng(daging) {
return daging + ' goreng'
}
// var foods = animals.map(digoreng)
var foods = animals.map(function(daging) {
return daging + ' goreng'
@rahmatrhd
rahmatrhd / git-flow.md
Last active May 18, 2019 09:26
First Time to Git

Cloning Repository and Basic Stuff

1. Clone from remote repository

  1. Click on the "Clone or download" button
  2. Copy the URL. Chose "Clone with HTTPS" if you haven't setup your SSH
  3. Run git clone https://github.com/USERNAME/REPOSITORY_NAME.git in your terminal

2. Navigate to cloned repository

  1. After you cloning a repository, usually it make a new folder within you current directory named the same as REPOSITORY_NAME
  2. Navigate into it by running cd REPOSITORY_NAME
@rahmatrhd
rahmatrhd / color.ts
Created April 29, 2019 07:23
How to make an object type with the keys are members of an enum
enum PrimaryColor {
Blue,
Red,
Yellow,
}
type ColorRecipe = {
[T in PrimaryColor]: number
}
@rahmatrhd
rahmatrhd / README.md
Created February 2, 2019 04:11
Deploy react project to netlify

Drag and drop deploy

  1. Make sure you have created a netlify account
  2. build your project. You can run npm run build command if you init with create-react-app, or next build if using next
  3. In netlify app/site-list page, drag and drop your project's build folder
  4. Wait until the process is done
  5. Visit the site link and enjoy
@rahmatrhd
rahmatrhd / README.md
Last active February 2, 2019 03:52
Firebase Initialization

Initialize firebase project

  1. Login with your google account then go to https://firebase.google.com/
  2. Click "Get Started" button
  3. In the welcome page, add new Project
  4. Fill the project name, project id, region/locations of your project (choose the nearest to your country), accept the terms and submit the form
  5. Done

Realtime database