Skip to content

Instantly share code, notes, and snippets.

@akella64
akella64 / handling_multiple_github_accounts.md
Created August 12, 2022 04:34 — 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

@akella64
akella64 / common.js
Created December 28, 2021 10:57
img-to-svg
// SVG icons
$('img.svg').each((i, e) => {
const $img = $(e);
const imgID = $img.attr('id');
const imgClass = $img.attr('class');
const imgURL = $img.attr('src');
$.get(imgURL, (data) => {
let $svg = $(data).find('svg');
if (typeof imgID !== 'undefined') {
$svg = $svg.attr('id', imgID);
@akella64
akella64 / common.js
Last active December 28, 2021 10:56
smooth transition for id
//smooth transition for id
$("body").on('click', '[href*="#"]', function(e){
var fixed_offset = -40;
$('html,body').stop().animate({ scrollTop: $(this.hash).offset().top - fixed_offset }, 1000);
e.preventDefault();
});
@akella64
akella64 / common.js
Created December 28, 2021 10:55
kirillic words
//kirillic words
$('.kirillic-input').on('keydown', function() {
var that = this;
setTimeout(function() {
var res = /[^а-яА-ЯїЇєЄіІёЁ ]/g.exec(that.value);
that.value = that.value.replace(res, '');
}, 0);
});
@akella64
akella64 / common.js
Created December 28, 2021 10:54
scroll-top
//scroll top
$("body").append('<div class="scroll-top"><img class="svg scroll-up-icon" src="/images/chevron-up-solid.svg" alt="Вверх">');
$(window).scroll(function () {
if ($(this).scrollTop() > 0) {
$('.scroll-top').fadeIn();
} else {
$('.scroll-top').fadeOut();
}
});
$('.scroll-top').click(function () {