Skip to content

Instantly share code, notes, and snippets.

View rezaindrag's full-sized avatar
🎯
Focusing

Reza Indra rezaindrag

🎯
Focusing
View GitHub Profile
@rezaindrag
rezaindrag / gist:d854284c00b61cd2faa4dc1e380f1003
Last active June 11, 2022 08:01 — forked from jacksonfdam/gist:3000275
Regular Expressions List
//Regular Expressions List
//Short Tutorial
\ // the escape character - used to find an instance of a metacharacter like a period, brackets, etc.
. // match any character except newline
x // match any instance of x
[^x] // match any character except x
[x] // match any instance of x in the bracketed range - [abxyz] will match any instance of a, b, x, y, or z
| // an OR operator - [x|y] will match an instance of x or y
syntax = "proto3";
package grpc;
option go_package = "./grpc";
service RecipeService {
rpc FetchRecipe(RecipeFilter) returns (RecipeResult) {}
}
service RecipeCategoryService {
@rezaindrag
rezaindrag / learn-k8s.md
Created January 4, 2021 07:20
Kubernetes Basic

Terms in Kubernetes

Komponen & Arsitektur Kubernetes

K82 Component

Kubernetes Cluster

  • Ketika kita me-running sebuah Kubernetes, artinya kita me-running sebuah Cluster (Kubernetes Cluster).
  • Cluster terdiri dari dua bagian besar, yakni Kubernetes Master dan Kubernetes Worker/Node
[
{
"id": "c-17",
"title": "Campaign and Activity",
"items": [
{
"id": "47",
"type": "link",
"saved": false,
"text": "Chef Siscaa",
const expect = require("chai").expect;
const { spy, stub } = require("sinon");
const companyService = require("../src/services/company.service");
const companyHandler = require("../src/handlers/company.handler");
const companyProfileMock = {
companyName: 'Facebook Inc',
companyUsers: [
{ id: 1, name: 'mojombo' },
const expect = require("chai").expect;
const { stub } = require("sinon");
const companyRepository = require("../src/repositories/company.repository");
const companyService = require("../src/services/company.service");
const usersMock = require("./mocks/users");
const employeesMock = require("./mocks/employees");
describe("test company service", function () {
afterEach(() => {
const expect = require("chai").expect;
const nock = require("nock");
const companyRepository = require("../src/repositories/company.repository");
const usersMock = require("./mocks/users");
describe("test company repository", function () {
after(function() {
nock.restore();
});
const companyService = require("../services/company.service");
async function fetchCompanyProfile(req, res) {
try {
const companyProfile = await companyService.fetchCompanyProfile();
res.json(companyProfile);
} catch (e) {
errorResponse(e, res);
}
const companyRepository = require("../repositories/company.repository");
async function fetchCompanyProfile() {
const users = await companyRepository.fetchUsers();
const employees = await companyRepository.fetchEmployees();
const companyUsers = [];
for (let user of users) {
companyUsers.push({
id: user.id,
const axios = require("axios");
async function fetchUsers() {
const { data } = await axios.get("https://api.github.com/users");
return data;
}
async function fetchEmployees() {
const { data: { data } } =