Skip to content

Instantly share code, notes, and snippets.

View inapeace0's full-sized avatar
🔥
Looking for an opportunity to support business

inapeace0

🔥
Looking for an opportunity to support business
View GitHub Profile
@nivethan-me
nivethan-me / README.md
Last active May 21, 2024 10:56
Setup a Next.js 13 project with Eslint + Prettier with automatic tailwind class sorting
@CamilleMo
CamilleMo / multiprocessing.md
Last active December 22, 2022 03:46
This is a guide on how to use the multiprocessing module

Introduction

The multiprocessing module was defined in PEP 371 by Jesse Noller and Richard Oudkerk. The idea behind this module is to take advantage of multiple processors on a machine. This module is very similar to the threading module.
Given that you use processes you can avoid the Global Interpreter Lock (GIL). Let's start by using the Process class.

Getting Started With Multiprocessing

The Process class is very similar to the threading module’s Thread class.

@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.