Skip to content

Instantly share code, notes, and snippets.

View Ganbin's full-sized avatar
🌱
Building

Gabriel Inzirillo Ganbin

🌱
Building
  • Biel / Bienne
  • 13:18 (UTC +02:00)
View GitHub Profile
@greimela
greimela / index.html
Created January 19, 2024 11:39
Minimal Chia WalletConnect implementation
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Chia WalletConnect Demo</title>
</head>
<body>
<div>
<button id="connect-button">Connect Wallet</button>
@SlowestTimelord
SlowestTimelord / chia-gpu-cpu-plotting-options.md
Last active April 3, 2023 17:34
Chia GPU and CPU plotting options
@ziplex
ziplex / fix-ubuntu-with-kernal-boot-options.sh
Created August 28, 2020 18:49 — forked from donrestarone/fix-ubuntu-with-kernal-boot-options.sh
fixing ubuntu system lockups with Ryzen CPU's
# open the boot parameters file for the linux kernal
sudo nano /etc/default/grub
# we will be editing the 'GRUB_CMDLINE_LINUX_DEFAULT' key
#set it to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.max_cstate=1 rcu_nocbs=0-11"
# test for a while and then set it to 5 if all is well
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash processor.max_cstate=5 rcu_nocbs=0-11"
@johnwgillis
johnwgillis / How to setup GPG for git.md
Last active April 22, 2024 17:13
How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

How to setup GPG for signing commits with Git, SourceTree, and GitHub on Mac

  1. Install GPG tools
    1. Install GPG tools and setup pin entry by running:
    brew install gnupg pinentry-mac
    mkdir -m 700 -p ~/.gnupg
    echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
    killall gpg-agent
    
@Brainiarc7
Brainiarc7 / C-states.md
Created July 14, 2018 00:20 — forked from wmealing/C-states.md
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

@Bilka2
Bilka2 / webhook.py
Last active April 26, 2024 08:29
Simple discord webhook with python
import requests # dependency
url = "<your url>" # webhook url, from here: https://i.imgur.com/f9XnAew.png
# for all params, see https://discordapp.com/developers/docs/resources/webhook#execute-webhook
data = {
"content" : "message content",
"username" : "custom username"
}
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active May 3, 2024 20:50
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:

@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}

Why I hate TypeScript

Warning: These views are highly oppinated and might have some slightly incorrect facts. My experience with typescript was about 2 weeks in Node and a week in angular2.

Not Standard

TypeScript is implementing their own take on JavaScript. Some of the things they are writing will likely never make it in an official ES* spec either.

Technologies that have competing spec / community driven development have a history of failing; take: Flash, SilverLight, CoffeeScript, the list goes on. If you have a large code base, picking TypeScript is something your going to be living with for a long time. I can take a bet in 3 years JavaScript will still be around without a doubt.

Its also worth noting that they have built some things like module system and as soon as the spec came out they ditched it and started using that. Have fun updating!

@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule