Skip to content

Instantly share code, notes, and snippets.

@Joao-Peterson
Joao-Peterson / gmk67-manual.md
Last active April 19, 2024 10:19
GMK67 manual (English)
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active April 19, 2024 10:17
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
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"
@mrnugget
mrnugget / go-sqlite3_database_is_locked.go
Created March 3, 2016 05:58
Program that tests the concurrency issues with go-sqlite3. This will create two tables: `products` and `users`. One goroutine will repeatedly read from the `products` table in N fresh goroutines. At the same time ONE goroutine writes to the other table.
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"sync"
"time"
@rosswf
rosswf / k3s.md
Last active April 19, 2024 10:15
Deploy HA k3s with kube-vip and MetalLB using k3sup

Prerequisites

kubectl

Install the required tools for deploying and controlling k3s.

Installation Docs:

# Download
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
@wojteklu
wojteklu / clean_code.md
Last active April 19, 2024 10:15
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@Birch-san
Birch-san / CUDA-12-1-1-pytorch.md
Last active April 19, 2024 10:12
Installing CUDA 12.1.1 + PyTorch nightly + Python 3.10 on Ubuntu 22.10

Installing CUDA 12.1.1 + PyTorch nightly + Python 3.10 on Ubuntu 22.10

Should you keep your NVIDIA driver?

CUDA 12.1.1 toolkit is gonna offer to install Nvidia driver 530 for us. It's from New Feature branch. It's likely to be newer than the default Nvidia driver you would've installed via apt-get (apt would prefer to give you 525, i.e. Production Branch).

If you're confident that you already have a new enough Nvidia driver for CUDA 12.1.1, and you'd like to keep your driver: feel free to skip this "uninstall driver" step.

But if you're not sure, or you know your driver is too old: let's uninstall it. CUDA will install a new driver for us later.

@hfossli
hfossli / gist:7234623
Last active April 19, 2024 10:09
KVO on a views geometry
- (void)viewDidLoad
{
[super viewDidLoad];
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 300, 200)];
view.backgroundColor = [UIColor blueColor];
[self.view addSubview:view];
[view addObserver:self forKeyPath:@"frame" options:0 context:NULL];
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active April 19, 2024 10:09
crack activate Office on mac with license file
@b333z
b333z / gist:1048400
Created June 27, 2011 06:35 — forked from maxsum-corin/gist:1044165
Multiple windows in vim
:split filename
ctrl-w w split window and load another file
:vsplit filename
ctrl-w v vertical split
:hide
ctrl-w q close current window
ctrl-w arrow move cursor up/down/left/right a window
ctrl-w ctrl-w move cursor to another window (cycle)