Snippets Collections
# ======================= [ MERGE TWO GIT BRANCH ] =======================
I have a branch named BranchA from master. I have some changes in BranchA (I am not going to merge changes from BranchA to master).
Now I have created another branch from master named BranchB.
How can I copy the changes from BranchA to BranchB?

Answer:
git checkout BranchB
git merge BranchA

or if you didn't create BranchB yet you can do:
git checkout BranchA
git checkout -b BranchB

This is all if you intend to not merge your changes back to master. Generally it is a good practice to merge all your changes back to master, and create new branches off of that.

Also, after the merge command, you will have some conflicts, which you will have to edit manually and fix.

Make sure you are in the branch where you want to copy all the changes to. git merge will take the branch you specify and merge it with the branch you are currently in.


# ======================= [ RESET A BRANCH ] =======================
-> get back to a commit by their commit id or the order.
>>> 
  Step 1: 
  	1st check on which commit you want to move to, using `git log`.
  Step 2:
  	then move to that using `git reset`, say you want to move the branch head backward by two steps. so you do --> `git reset --hard HEAD~2`
    
>>> 
      Using the commit id/commit hash might also work. But I have not tried that.
      Command: https://stackoverflow.com/a/3639154
      	`$ git reset --hard <commit-before-merge>`
       OR,
         git reset --hard <commit-hash>
         git push -f origin master
    
# ======================= [ GIT STASH ] =======================
when switching from one branch to another, if this error comes `error: The following untracked working tree files would be overwritten by checkout:`. Then you either need to stash or clean. Better is stash.

-> `git stash --include-untracked`
❌ Never do stash, it deletes all the changes that have been added after the last commit.
-> Use `git stash pop` to undeo the recent stash. 
// https://stackoverflow.com/questions/10827160/undo-a-git-stash
# ======================= [DIFF FILES] ========================
$ git diff HEAD:<version 1 of file1> <version 2 of file1>
  
git diff HEAD:Carla/carla_scripts/initialpose_recorder.py Carla/carla_scripts/initialpose_recorder.py


# ========== [UNCOMMIT A FILE FROM CURRENT/LAST COMMIT ] ==========
[https://stackoverflow.com/questions/12481639/remove-file-from-latest-commit]
- git reset --soft HEAD~1
- git restore --staged path/to/unwanted_file
- git commit -c ORIG_HEAD
 
# ==========   [GIT COMMIT W/O MESSAGE]   =========
 - git commit -am.

# ============  [GIT BRANCHES]  =====================
 - `git branch -a`  => shows all branches
 - `git branch -r` => shows only remote branches
 - `git branch`    => shows only local branches
 - `git checkout <branch name>`  => add a remote branch to your local
 - if you are upable to add branch using git checkout you might need to do `git fetch -all`. then do `git checkout <branch name>` again.
 
 
 # ===============  [REGULAR GIT COMMANDS WHEN WORKING @ ALIVE]  =======================
 - git status
 - git add commonroad_dev/ [NEVER DO `git add .`, if needed add the whole folder]
 - git commit -m "message"
 - git push -u origin <branch-name>
   
   
# ==================  [CREATE A GIT BRANCH] ===========================
   - git branch my_branch    [This create a branch named `my_branch`] 
   - git checkout my_branch  [after creatng you switch to the `my_branch`]
 

#=================== [GIT REBASE]  ==============================

  - https://github.com/soumya997/alive-test/blob/main/git_rebase.md 
# Visualize one training batch
for images, labels in train_data_loader:
    fig, ax = plt.subplots(figsize = (10, 10))
    ax.set_xticks([])
    ax.set_yticks([])
    ax.imshow(make_grid(images, 4).permute(1,2,0))
    break
👨‍💻 boilerplate code


Hugo:
hugo new content/posts/new-car.md
hugo new site my-portfolio-example
# defaultTheme = "dark"

Git push:
# Example of the commands and how they apply to my project
echo "# obsidian-opencv" >> README.md
  git init
  git add README.md
  git commit -m "first commit"
  git branch -M main
  git remote add origin git@github.com:soumya997/obsidian-opencv.git
  git push -u origin main

# when pushing from a new branch
git checkout -b <branch>
git add .
git commit -m "comment"
git push -u origin <branch>

# Bring a local folder to remote git repo
// https://superuser.com/a/1412081
 $ git init
 $ git add .
 $ git commit -m "First commit"
 $ git remote add origin <remote repository URL>
 # Sets the new remote
 $ git remote -v
 # Verifies the new remote URL

# create pandas df from python dict
data = {'col_1': [3, 2, 1, 0], 'col_2': ['a', 'b', 'c', 'd']}
pd.DataFrame.from_dict(data)


Drive mount:
from google.colab import drive
drive.mount("/content/gdrive")

python essential:
#!/usr/bin/env python

python virtual env:
pip install -r requirements.txt
mkdir TextGenEnv
virtualenv TextGenEnv
TextGenEnv\Scripts\activate (for bash source ./Scripts/activate)
pip install -r requirements.txt
python -m scikit-learn --version


<p align="center">
<img width="300" height="250" src="https://i.ibb.co/sHF9d7k/Smart-GForms.png">
</p>

python encoder_train.py name data/SV2TTS/encoder/ --no_visdom
data = np.transpose(data, axes=[3, 2, 1, 0])


vivek.poddar@gmail.com


cliche


g++ -o rp linear_search.cpp


<p align="center">
<img src="../imgs/pointer.png">
</p>
To insert tab space between two words/sentences I usually use
&emsp; and &ensp;


grit
fast learn
fast fail
intelectual decision(head quater at pakistan)
passion
![](https://github.com/SauravMaheshkar/siim-covid19/blob/main/assets/SIIM-COVID19%20Github%20Banner.png?raw=true)
collage, professional, modern,executive

---
layout: post
title: Flake it till you make it
subtitle: Excerpt from Soulshaping by Jeff Brown
cover-img: /assets/img/path.jpg
thumbnail-img: /assets/img/thumb.png
share-img: /assets/img/path.jpg
tags: [books, test]
---



-------Pandas---------
show all row and columns:
pd.set_option('display.max_columns', None)
pd.set_option('display.max_rows', None)
------------------------------------------------


+++++++++Center text in markdown+++++++++
<h1 align="center">Crima</h1>
+++++++++++++++++++++++++++++++++++++


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
i think it would be great to have - [ ] if unchecked and - [x]if checked in lists.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


_______________Windows terminal EXE________________________
wt.exe
______________________________________________________


npx localtunnel --port 8501


I have been watching some deep Learning implementations, But don't really understand why the model is taking two inputs, `X_train, assets_train` for training? Why can't someone just train the model with the provided training data, is it really necessary to include `asset_details.csv`?
**It would be really helpful if you can answer. Thank you.**


coomer






1e-4 = 0.0001


Shift+Ctrl+C to add a checkbox
Ctrl+B to bold
Ctrl+I to italic
Ctrl+U to underline
Shift+Ctrl+S.... you know the story




https://github.com/AlexeyAB/darknet
https://github.com/DarkStar1997/darknet-cpp-app


As @slawekbiel said ` Likewise restarting the kernel picks up the new version.`
1. After doing `!pip -v install numpy==1.20.0`
2. Do `Run` --> `restart and clear cell output`/ I understand that
3. And then run the code,
```
import numpy as np
print(np.__version__)
arr = np.zeros((1,2)) + np.zeros((3,2,1))
np.broadcast_shapes((1, 2),(3,2,1))
# 1.20.0
# (3, 2, 2)
```
<p align="center">
<img src="https://i.imgur.com/ZatsYza.png">
</p>

https://i.imgur.com/ZatsYza.png
<!doctype html>

<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <title></title>

	/* CSS STYLESHEET */

	<link rel="stylesheet" href="styles.css">

	/* BULMA */

 	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.3/css/bulma.min.css">
      
	/* FONTAWESOME */
      
	<script src="https://use.fontawesome.com/releases/v5.15.4/js/all.js" data-auto-	a11y="true"></script>


</head>

<body>
      
	/* JAVASCRIPT SCRIPTS /*
    
	<script src="script.js"></script>

</body>
</html>
star

Wed Oct 12 2022 07:03:16 GMT+0000 (Coordinated Universal Time)

#git #boilerplate #snippet
star

Wed Feb 09 2022 18:13:34 GMT+0000 (Coordinated Universal Time) https://www.kaggle.com/jainamshah17/pytorch-starter-image-classification

#boilerplate #python #grid
star

Sat Feb 05 2022 06:32:42 GMT+0000 (Coordinated Universal Time)

#boilerplate
star

Fri Jan 21 2022 12:04:36 GMT+0000 (Coordinated Universal Time)

##html ##css #javascript #fontawesome #bulma #boilerplate #imports

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension