Skip to content

Instantly share code, notes, and snippets.

View brunodrugowick's full-sized avatar
🐢
Focusing

Bruno Drugowick Muniz brunodrugowick

🐢
Focusing
View GitHub Profile
@weinbrenner
weinbrenner / FixCS.GOinUbuntu21.10.txt
Created January 4, 2022 07:18
Fix CS.GO lib problem in Ubuntu 21.10
# After upgrading Ubuntu to 21.10 CS.GO in Steam for Linux stopped working
# (@see https://github.com/ValveSoftware/csgo-osx-linux/issues/2815
# and https://github.com/ValveSoftware/csgo-osx-linux/issues/2811
# )
# Here is how I fixed it:
# 0) Exit Steam, make sure it is not running anymore
$ ps aux | grep steam
@lagerone
lagerone / screen-brightness
Last active April 12, 2023 11:49
A script for adjusting screen brightness in Dell laptops with OLED screens in Ubuntu. It requires xrandr to be installed.
#!/usr/bin/python3
import logging
import os
import subprocess
import sys
from typing import Literal
logging.basicConfig(level=logging.DEBUG)
@ulisseslima
ulisseslima / FlexibleJpaRepository.java
Created April 17, 2019 02:31
Base JPA Repository that supports easier dynamic query building.
package it.murah.license.server.jpa;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.persistence.EntityManager;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
@sosedoff
sosedoff / 1_simple.go
Created July 16, 2016 18:45
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active July 5, 2024 06:54
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:

@harding
harding / instructions.md
Last active May 7, 2024 06:25
Working With Multiple Repositories On GitHub

Working With Multiple Repositories On GitHub

Most projects on GitHub have a main repository that's the focal point of activity. For example, the Example organization has the Example.com repository:

https://github.com/example/example.com

Developers of Example.com typically call this the 'upstream' repository. We'll come back to it in a moment.

@Chaser324
Chaser324 / GitHub-Forking.md
Last active July 22, 2024 14:45
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j