Skip to content

Instantly share code, notes, and snippets.

View Raffaferreira's full-sized avatar
🏠
Working from home

Rafael Ferreira Raffaferreira

🏠
Working from home
  • São Paulo, Brazil
View GitHub Profile
@benjaco
benjaco / ApiClient.cs
Last active February 8, 2023 20:15
Get Post Delete Put C# Generic Class
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
/*
Husk at rette namespace
Du kan saette et default URL ved at replace [DEFAULT URL] med dit url
*/
namespace [namespace].Common
@aaronjwood
aaronjwood / BinarySearchTree.cs
Created February 15, 2016 05:57
Binary search tree implementation in C#
using System;
using System.Diagnostics;
namespace BinarySearchTree
{
class Node
{
public int value;
public Node left;
public Node right;
@chrismccoy
chrismccoy / gitcheats.txt
Last active February 27, 2025 15:51
git cheats
# alias to edit commit messages without using rebase interactive
# example: git reword commithash message
reword = "!f() {\n GIT_SEQUENCE_EDITOR=\"sed -i 1s/^pick/reword/\" GIT_EDITOR=\"printf \\\"%s\\n\\\" \\\"$2\\\" >\" git rebase -i \"$1^\";\n git push -f;\n}; f"
# aliases to change a git repo from private to public, and public to private using gh-cli
alias gitpublic="gh repo edit --accept-visibility-change-consequences --visibility public"
alias gitprivate="gh repo edit --accept-visibility-change-consequences --visibility private"
# delete all your repos using gh-cli (please do not run this unless you want to delete all your repos)
gh repo list --limit 300 --json url -q '.[].url' | xargs -n1 gh repo delete --yes