Skip to content

Instantly share code, notes, and snippets.

View primayudantra's full-sized avatar
👋
Hi, Prima here!

Prima Yudantra primayudantra

👋
Hi, Prima here!
View GitHub Profile
@primayudantra
primayudantra / handling_multiple_github_accounts.md
Created August 20, 2022 14:52 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@primayudantra
primayudantra / multiple_ssh_setting.md
Created August 20, 2022 12:47 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@primayudantra
primayudantra / node-npm-install.md
Created June 3, 2020 15:18 — forked from rcugut/node-npm-install.md
Install node & npm on Mac OS X with Homebrew

DEPRECATED as of macOS 10.13 (High Sierra). See the new GUIDE to install nvm and yarn for macOS (updated July 2019)

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

FROM node:12
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
@primayudantra
primayudantra / icu4c-63.md
Last active July 11, 2022 11:52
Fix icu4c issues and switch version to 63.1

Answer from : https://stackoverflow.com/a/55828190

Solution:

  1. cd to Homebrew's formula directory cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula

  2. Find desired commit (version 63 for icu4c) to checkout git log --follow icu4c.rb

@primayudantra
primayudantra / docker-composer.yml
Created July 19, 2019 09:23
setup elasticsearch and kibana
version: '2'
services:
elasticsearch:
image: elasticsearch:7.2.0
environment:
- discovery.type=single-node
ports:
- 127.0.0.1:9200:9200
kibana:
image: kibana:7.2.0
var dns = require('dns');
function lookup(domain) {
return new Promise((resolve, reject) => {
dns.reverse(domain, (err, address, family) => {
if (err) {
reject(err)
} else {
resolve(address)
}
var dns = require('dns');
function reverseLookup(ip, cb) {
dns.reverse(ip, function(err,domains){
if(err!=null) callback(err);
cb(domains)
});
@primayudantra
primayudantra / 1_phpunit-api.md
Created January 28, 2019 05:34 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()