Skip to content

Instantly share code, notes, and snippets.

View sanjarcode's full-sized avatar

Sanjar Afaq sanjarcode

View GitHub Profile
@sanjarcode
sanjarcode / cloudSettings
Last active February 17, 2023 20:41
STALE, NOT IN USE vscode Settings Sync Gist
{"lastUpload":"2022-08-27T11:31:09.388Z","extensionVersion":"v3.4.3"}
@sanjarcode
sanjarcode / createTextButton.js
Last active January 18, 2021 22:48
gnome-shell-extensions snippets
// Use this in init()
function createTextButton(textP = "Click Here!", action) {
const St = imports.gi.St;
const Main = imports.ui.main;
// create button
button = new St.Bin({
style_class: "panel-button",
reactive: true,
can_focus: true,
x_fill: true,
@sanjarcode
sanjarcode / 1-os-installation.md
Last active September 11, 2024 15:50
Computer setup - installing OS, post installation sets - Ubuntu (20.04), or macOS

Installation steps

  1. Windows + Ubuntu dual boot Install Windows first (on the "left" side of the disk, keep any OS agnostic disk parititons in the middle and leave space for Ubuntu on "right side), then install Ubuntu
  2. Windows - Create live USB using ISO with Rufus and install
  3. MacOS - comes installed
  4. Linux - Ubuntu Create live USB using ISO with Rufus (Windows) or Startup Disk Creator (Ubuntu), set up `/` and `/home` and swap spaces and install

Partition sizes

512 GB - dual boot OK

@sanjarcode
sanjarcode / .bash_aliases
Last active October 21, 2024 05:39
Dotfiles - Linux, MacOS shell primer files - .bashrc and others
#!/usr/bin/env bash
# CUSTOM Aliases #####################
# git
alias gco="git checkout"
alias ga="git add"
alias gunadd="git restore --staged" # Unstage path1 path2...
alias gcan="git commit --amend --no-edit"
alias gcm="git commit -m"
@sanjarcode
sanjarcode / how_to_share.md
Last active February 26, 2024 04:12
Browser hacks/tools
@sanjarcode
sanjarcode / .gitconfig
Last active October 21, 2024 05:30
Multiple Git accounts on a device, with SSH keys
# ~/.gitconfig - the global config
[user]
name = Muhammad Sanjar Afaq
email = [email protected]
[includeIf "gitdir:~/volopay-work/"]
path = ~/volopay-work/.gitconfig
[core]
editor = code --wait
@sanjarcode
sanjarcode / ec2-restart
Last active April 16, 2022 08:08
Setup domain and hosting on server
### EC2 restart
If your server is restarted, its public IPv4 address may change, in that case,
just update the `Route 53` type A record with the new address.
@sanjarcode
sanjarcode / volopay_test.py
Last active December 20, 2022 05:45
Code files
import unittest
class PlaneSeating:
def __init__(self, seat_block_column_n_row, number_of_passsengers):
self.seat_block_column_n_row = seat_block_column_n_row
self.number_of_passsengers = number_of_passsengers
# calculate number of seats of each type
@sanjarcode
sanjarcode / .megasyncignore
Created January 18, 2023 03:58
Personal cloud sync ignore file
# Context for exclusion
# 1. For excluding files, use .gitignore as hint.
# 2. Soft exclusion - Don't copy .gitignore blindly. IDE settings are still.
# .gitignore syntax - MEGAsync exclusion syntax
# 1. /dirName - dirName - directory exclusion
# 2. dir1/dir2 - */dir1/dir2 - MEGAsync is not consistent with exclusion syntax
# Tip - Delete all files to be excluded before settings the exclusion.
# Otherwise the excluded file will have a single stagnant instance in the cloud.
@sanjarcode
sanjarcode / .gitignore
Last active September 30, 2024 06:10
Custom JS for the browser
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json