Skip to content

Instantly share code, notes, and snippets.

View 1solation's full-sized avatar
💻
Computer says no

Hasib Ahmed 1solation

💻
Computer says no
View GitHub Profile
@1solation
1solation / Code-Navigation-within-VS-Code.md
Last active March 20, 2024 10:03
Code Navigation within VS Code

VS Code keyboard shortcut: workbench.action.navigateBackward - Ctrl, -

VS Code keyboard shortcut: workbench.action.navigateForward - Ctrl, Shift, -

@1solation
1solation / umcommit-local-keep-changes.md
Created February 21, 2024 10:30
Uncommit local commit and restage changes

To uncommit your local commit (which has not yet been pushed to Github) and keep your staged changes use:

git reset --soft HEAD~1

This command will undo your last commit, but it will keep your changes and your staging intact.

@1solation
1solation / reorder-preferred-wifi-networks.md
Created February 1, 2024 12:50
reorder preferred wifi networks mac OS

networksetup -listpreferredwirelessnetworks en0

find your wifi network you want to change

Preferred networks on en0:
	Banana
	CafeWifi
	MyPhoneHotspot
@1solation
1solation / docker-compose-rm-reattach-networks.md
Created July 5, 2023 11:15
Docker compose rm and reattach networks

If you've created a docker network by using docker network create NETWORK-NAME prior to using docker compose up

You may get $ docker-compose up pm-amqp pm-zookeeper pm-db pm-trdapi

[+] Running 3/0
 ✔ Container XXX-pm-zookeeper-1  Created                                 0.0s
 ✔ Container XXX-pm-amqp-1       Created                                 0.0s
 ✔ Container XXX-pm-db-1 Created 0.0s
@1solation
1solation / asdf-install-java-plugin.md
Created June 20, 2023 09:38
asdf install java plugin

First add the plugin for Java

asdf plugin-add java

List available versions

asdf list-all java

Install a version, 17.0.6 given as an example

@1solation
1solation / numToString.js
Created February 20, 2023 12:40
numToString.js
for (let i = 1; i <= 100; i++) {
let numString;
switch (i) {
case 1:
numString = "one";
break;
case 2:
numString = "two";
break;
case 3:
@1solation
1solation / binsearch_fixed.js
Created December 19, 2022 17:51
coding solution - binary search function in JS, with comments
function binary_search(x, sorted_collection, low = 0, high = null) {
// x is target
// sorted_collection I will assume is always sorted in ascending numerical order AND starting from 1, due to the test cases
// low is the start index
// high is the end index
// initialise high to the last index of the array if it's not provided
if (high === null) {
high = sorted_collection.length - 1; // setting high as highest index, which start from 0 not 1 (hence the -1)
} else if (high < 0) {
throw new RangeError("High index out of range");
@1solation
1solation / binsearch.js
Created December 19, 2022 17:35
coding problem - binary search function in JS, with comments
function binary_search(x, sorted_collection, low = 0, high = null) {
// x is target
// sorted_collection I will assume is always sorted in ascending numerical order AND starting from 1
// low is the start index
// high is the end index
if (high === null) {
high = sorted_collection.length; // using .length will return 1 index higher as arrays start with a 0 index, not 1
} else if (high < 0) {
throw new RangeError("High index out of range");
}
@1solation
1solation / mermaid-test.md
Created December 1, 2022 12:33
test mermaid diagram
sequenceDiagram;
Alice ->> Bob: Hello Bob, how are you?;
Bob-->>John: How about you John?;
Bob--x Alice: I am good thanks!;
Bob-x John: I am good thanks!;
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.;

Bob-->Alice: Checking with John...;
Alice-&gt;John: Yes... John, how are you?;
@1solation
1solation / vs-code-background.md
Last active November 23, 2022 22:03
backgrounds to spice up VS code

download the extension called background, extension ID: shalldie.background, on VS code.

This is what it will look like:

image

Copy the following inside your settings.json: