Skip to content

Instantly share code, notes, and snippets.

@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active May 7, 2024 22:00
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 22:00
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

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@thomashartm
thomashartm / aws-sam-colima.md
Last active May 7, 2024 21:58
Enable AWS SAM local to run without Docker Desktop but Colima + Docker Daemon on MacOs

AWS SAM local commands without Docker Desktop

AWS SAM local commands check for the existance of DOCKER_HOST. If the variable is not present, it will fail with the following error message

Error: Running AWS SAM projects locally requires Docker. Have you got it installed and running?

Replace it with Colima

Point DOCKER_HOST to unix socket of the Docker Daemon.

@kirilkirkov
kirilkirkov / Multipart RAR Files
Created October 19, 2015 08:29
What is multipart archive
Hi! I am a complete newbie to RAR files and I want to learn what to do with them. I was just wondering:
What is a multipart RAR file?
1. A multipart RAR file is a standard RAR file, that was split into many smaller parts. This way, very large Archives can be placed on many small mediums, e.g. CDs.
2. The parts of a multipart RAR file are usually named "xyz.part1.rar", "yxz.part2.rar" etc. or "xyz.rar", "xyz.r01", "xyz.r02" etc. Depending on how many parts have been generated, there may be a few or a few hundred of these files.
3. A multipart RAR file can additionally be encrypted and protected by a password. Read more on password protection in the protected RAR files section of this FAQ.
4. BE CAREFUL: Sometimes multipart RAR files are used for phishing. Learn more in the phishing RAR files section of this FAQ.
5. Sometimes a multipart RAR file can be damaged and corrupted. Please take a look at the corrupted RAR files section of this FAQ to learn more.
Hi! I am an absolute beginner and
Home/Core TX9XD-98N7V-6WMQ6-BX7FG-H8Q99
Home/Core (Country Specific) PVMJN-6DFY6-9CCP6-7BKTT-D3WVR
Home/Core (Single Language) 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH
Home/Core N 3KHY7-WNT83-DGQKR-F7HPR-844BM
Professional W269N-WFGWX-YVC9B-4J6C9-T83GX
Professional N MH37W-N47XK-V7XM9-C7227-GCQG9
Professional Enterprise
Professional Workstation
Enterprise NPPR9-FWDCX-D2C8J-H872K-2YT43
Enterprise N DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4
@joerodgers
joerodgers / Get-SiteCollectionPermission.ps1
Last active May 7, 2024 21:53
Example script that users the PnP.PowerShell module to export the permissions of all uniquely permissioned webs and associated M365 Groups Owners and M365 Group Members
#requires -Modules @{ ModuleName="PnP.Powershell"; ModuleVersion="1.11.0" }
[System.Net.WebRequest]::DefaultWebProxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
function Get-SiteCollectionPermission
{
<#
.SYNOPSIS
Returns all the webs in the site collection with unique permissions. If the site is group connected, also exports the group owners and group members.
@PurpleVibe32
PurpleVibe32 / vmwk17key.txt
Last active May 7, 2024 21:52
Free VMware Workstation Pro 17 full license keys
Install VMWare Workstation PRO 17 (Read it right. PRO!)
Also, these keys might also work with VMWare Fusion 13 PRO. Just tested it.
Sub to me on youtube pls - PurpleVibe32
if you want more keys - call my bot on telegram. @purector_bot (THE BOT WONT REPLY ANYMORE) - Or: https://cdn.discordapp.com/attachments/1040615179894935645/1074016373228978277/keys.zip - the password in the zip is 102me.
---
This gist can get off at any time.
PLEASE, DONT COPY THIS. IF YOU FORK IT, DONT EDIT IT.
*If you have a problem comment and people will try to help you!
*No virus