Skip to content

Instantly share code, notes, and snippets.

View NeroBlackstone's full-sized avatar
🎹

Nero Blackstone​ NeroBlackstone

🎹
View GitHub Profile
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active July 18, 2025 01:40
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:

@jayspeidell
jayspeidell / kaggle_download.py
Last active July 18, 2023 12:23
Sample script to download Kaggle files
# Info on how to get your api key (kaggle.json) here: https://github.com/Kaggle/kaggle-api#api-credentials
!pip install kaggle
api_token = {"username":"USERNAME","key":"API_KEY"}
import json
import zipfile
import os
with open('/content/.kaggle/kaggle.json', 'w') as file:
json.dump(api_token, file)
!chmod 600 /content/.kaggle/kaggle.json
!kaggle config path -p /content
@Sg4Dylan
Sg4Dylan / BH1750_CTL.ino
Created June 24, 2019 12:58
显示器亮度自动调节套装
#include <Wire.h>
#include <BH1750.h>
BH1750 lightMeter;
void setup(){
Serial.begin(9600);
// Initialize the I2C bus (BH1750 library doesn't do this automatically)
// On esp8266 devices you can select SCL and SDA pins using Wire.begin(D4, D3);
Wire.begin();
@Sg4Dylan
Sg4Dylan / Lightpack.ino
Created June 6, 2020 03:22
Lightpack 开源破车
/*
* Arduino interface for the use of WS2812 strip LEDs
* Uses Adalight protocol and is compatible with Boblight, Prismatik etc...
* "Magic Word" for synchronisation is 'Ada' followed by LED High, Low and Checksum
* @author: Wifsimster <[email protected]>
* @library: FastLED v3.001
* @date: 11/22/2015
*/
#include <FastLED.h>
#define NUM_LEDS 50 // 设置灯珠总数(貌似不能超过 400 个
@888iee
888iee / virtualdisplay.md
Created August 29, 2024 15:19
How to create a virtual diplay on X11

This works only for nvidia cards running on x11!

I'm not responsible for any damage this might cause. Do at your own risk

Sometimes you will only have the console accessible, therefore open this document on another device. I tested this with the following versions.

|Software|Version|