Skip to content

Instantly share code, notes, and snippets.

View navsqi's full-sized avatar

shidqi navsqi

  • Jakarta, Indonesia
View GitHub Profile
@navsqi
navsqi / Install Composer to use MAMP's PHP.md
Last active October 18, 2022 07:39 — forked from kkirsche/Install Composer to use MAMP's PHP.md
How to install Composer globally using MAMP's PHP

##Create an alias to MAMP's PHP installation

To do this, we can simply create an alias for our bash profile. We'll be doing this is nano, though you can do it in vim or a number of other editors as well.

Within the terminal, run:

nano ~/.bash_profile
or
nano ~/.zshrc
@navsqi
navsqi / q1.md
Last active February 26, 2022 04:34

Some people have been studying the following problem: given two numbers, A and B, how many numbers from A to B, inclusive, are divisible by another number K. For example, if A is 1, B is 10, and K is 3, then there are 3 numbers that satisfy this: 3, 6, and 9. Help them by programming a solution to this problem!

Input:

The first line is the number of test cases T. Each test case has three numbers A, B, K, each on their own line given in that order.

Output:

For each test case, output one line of the form “Case C: X” (without the quotes), where C is the case number (starting from 1), and X is the number of integers between A and B, inclusive, that are divisible by K.

@navsqi
navsqi / cloudSettings
Last active February 3, 2022 15:22
Visual Studio Code Settings Sync Gist
{"lastUpload":"2022-02-03T15:22:54.138Z","extensionVersion":"v3.4.3"}
@navsqi
navsqi / NGINX _auth.conf
Last active December 7, 2021 14:58
NGINX api getway authentication & authorization
server {
listen 80;
listen [::]:80;
server_name "";
server_tokens off;
client_max_body_size 100M;
# Docs: https://nginx.org/en/docs/http/ngx_http_auth_request_module.html
location / {
# Sebelum request masuk, akan melewati /auth terlebih dahulu
@navsqi
navsqi / eslint-node-prettier
Created October 21, 2021 11:54
node eslint airbnb
npm i --save-dev eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-node eslint-plugin-import eslint-config-airbnb
import React, {Component, Fragment} from 'react';
import {
StyleSheet,
SafeAreaView,
View,
Dimensions,
ScrollView,
TouchableOpacity,
ActivityIndicator,
} from 'react-native';
@navsqi
navsqi / bash_alias.md
Created April 23, 2021 12:50
Membuat alias di bash

Untuk membuat alias Bash caranya cukup sederhana. Pertama, buka file ~/.bashrc lalu pastika baris berikut tidak dikomentari:

if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi

Baris tersebut bermaksud untuk membaca file bernama .bash_aliases. Jika file ini ada, maka kita dapat mulai menulis alias yang diinginkan didalamnya. Jika belum ada, maka buat sebuah file bernama ~/.bash_aliases lalu tambahkan baris berikut sebagai alias pertama:

@navsqi
navsqi / node_nginx_ssl.md
Last active December 1, 2021 13:16 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to Ubuntu Server using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Create a new user

# creating new user
adduser lukas