Skip to content

Instantly share code, notes, and snippets.

@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active April 27, 2024 08:50
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@sergiks
sergiks / README.md
Last active April 27, 2024 08:50
Let's Encrypt wildcard certificates in docker

NGINX and Certbot example with CloudFlare API in Docker

Sample config files to demonstrate seup that creates and updates free SSL certificates from Let's Encrypt given that the domains are maintained at CloudFlare service.

How it works

Certbot verifies domains ownership by accessing CloudFlare API that adds temporary TXT DNS records. To enable it You must provide your CloudFlare API token. More details in documentation for dns-cloudflare Certbot plugin.

Certbot saves created certificates in Docker volume certbot_etc. Pay attention to output of the certbot run - it mentions path to the created certificates.

@mkfares
mkfares / zsh-keyboard-shortucts.md
Last active April 27, 2024 08:49
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@vasiltabakov
vasiltabakov / FigureOptions.ts
Created October 7, 2017 09:47
Quill editor editable image caption
import Quill from 'quill';
import {TaskerFigure} from './TaskerFigure';
import Parchment from 'parchment';
export class FigureOptions {
quill: Quill;
figure;
overlay;
linkRange;
@journey-ad
journey-ad / 2233.zenra.js
Last active April 27, 2024 08:41
哔站直播间的2233娘挂件替换为全裸版本
// ==UserScript==
// @name 哔站直播全裸2233娘
// @description 哔站直播间的2233娘挂件替换为全裸版本
// @description:zh-TW 嗶站直播間的2233娘掛件替換為全裸版本
// @namespace https://github.com/journey-ad
// @author journey-ad
// @include *://live.bilibili.com/*
// @require https://cdn.jsdelivr.net/jquery/1.12.4/jquery.min.js

Windows 10 - Using Git Bash With TMUX

Why Not Use WSL?

I tried the WSL and it isn't quite seamless enough for me. I ran in to problems when editing in VSCode and having watchers on my files (ng serve, dotnet watch run, etc.). In addition, I kept running in to problems that only manifest themselves when running in WSL. For example, this issue with doing production builds and the terser plugin has made many a developer rage-quit on using WSL. Just figuring out that it was an issue with the WSL took a lot of time.

That terser plugin issue was never resolved and I ended up having to keep a git bash window open in addition to my WSL console window so I could do production builds. To make matters worse, my npm packages were platform-dependent so I couldn't use the same project folder. So, my procedure was: commit whatever changes to test branch, push to repo, git pull on my "windows" project folder, and do a production build there

@f-o
f-o / Jigidi-Magic-Stripes.js
Created January 27, 2024 08:39
Userscript to streamline Jigidi solving
// ==UserScript==
// @name Jigidi Magic Stripes
// @namespace me.danq.com.jigidi.magicstripes
// @match https://www.jigidi.com/solve/*
// @grant GM_getValue
// @grant GM_setValue
// @version 1.1
// @author Dan Q <https://danq.me>
// @description 23/03/2023, 14:32:30
// ==/UserScript==
@domske
domske / safari-fix-overflow-border-radius.md
Last active April 27, 2024 08:39
Bugfix (Workaround) for Safari (iOS): Border radius with overflow hidden does not work as expected.

There is a bug in Safari when using border-radius and overflow: hidden. Especially when applying transform to a child. In this case, overflow: hidden does not always work. The child ignores the border radius and overflows. It's a very old bug. And sadly it seems that it will never be fixed. Anyway, we can't wait for it.

There are some workaround. We need to place the element with the overflow attribute into a stacking context. I've tested the following workarounds on the latest version of iOS (14.4). You can choose what you want. But you should search the web for the particular attribute. (e.g. will-change should be rarely used. See docs)

Use this on the element with overflow: hidden and border-radius:

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 27, 2024 08:50
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@breithbarbot
breithbarbot / uninstall_zsh.sh
Last active April 27, 2024 08:34
Uninstall Zsh + Oh My Zsh + Powerlevel10k theme (macOS & Linux)
#!/bin/sh
# Install Zsh + Oh My Zsh + Powerlevel10k theme (macOS & Linux)
# run: sh -c "$(curl -fsSL "$(echo "$(curl -s "https://api.github.com/gists/254e58bd87009963b3f58405d75cbe6c")" | grep -o '"raw_url": *"[^"]*"' | cut -d'"' -f4)")"
# Remove installations + configurations
rm -f ~/.p10k.zsh
rm -rf -- ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
sh ~/.oh-my-zsh/tools/uninstall.sh -y
sudo chsh -s $(which bash)