Skip to content

Instantly share code, notes, and snippets.

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@joepie91
joepie91 / vpn.md
Last active February 2, 2026 11:30
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Aligning images

This is a guide for aligning images.

See the full Advanced Markdown doc for more tips and tricks

left alignment

@rawnly
rawnly / excuses.txt
Created August 24, 2018 19:38
All (literally) 145 sentences from developerexcuses.com
It was working in my head
Even though it doesn't work, how does it feel?
Oh, you said you DIDN'T want that to happen?
THIS can't be the source of THAT
I thought he knew the context of what I was talking about
I can have a look but there's a lot of if statements in that code!
It works, but it's not been tested
The accounting department must have cancelled that subscription
The marketing department made us put that there
I couldn't find any examples of how that can be done anywhere else in the project
@fnky
fnky / ANSI.md
Last active February 8, 2026 01:32
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27

Foreward

This document was originally written several years ago. At the time I was working as an execution core verification engineer at Arm. The following points are coloured heavily by working in and around the execution cores of various processors. Apply a pinch of salt; points contain varying degrees of opinion.

It is still my opinion that RISC-V could be much better designed; though I will also say that if I was building a 32 or 64-bit CPU today I'd likely implement the architecture to benefit from the existing tooling.

Mostly based upon the RISC-V ISA spec v2.0. Some updates have been made for v2.2

Original Foreword: Some Opinion

The RISC-V ISA has pursued minimalism to a fault. There is a large emphasis on minimizing instruction count, normalizing encoding, etc. This pursuit of minimalism has resulted in false orthogonalities (such as reusing the same instruction for branches, calls and returns) and a requirement for superfluous instructions which impacts code density both in terms of size and

@sr229
sr229 / .startEnv.vscode.sh
Created August 27, 2019 11:20
Silverblue delegate script for VSCode
#!/bin/sh
# Copyright 2019 (c) Ayane Satomi
# Public Domain
#
# Delegate Script for VSCode
# This makes sure VScode only runs in a Toolbox container.
# This only works with a default container.
FEDORA_DEFAULT_CONTAINER="fedora-toolbox-$(whoami)-30"
@Integralist
Integralist / Go vs Rust - syntax differences.md
Last active May 30, 2025 08:34
Go: syntax differences with Rust #go #rust

The following examples are written from the perspective of an engineer who writes code using the Go programming language, and so you'll find that I've written notes about how Rust is different and I don't really cover the why or how of the example Go code. Additionally, the Go examples are far from exhaustive because I'm using this as a 'scratch pad' for my Rust learnings.

Error Handling

Go example

@swinzy
swinzy / ConfigHowdy.sh
Created November 9, 2022 14:23
Config Howdy for Fedora 36 using GNOME
# !/bin/bash
# Reference: https://copr.fedorainfracloud.org/coprs/principis/howdy/
# sudo required
if ! [ $(id -u) = 0 ]; then
echo "Root privilege is needed. Please rerun the script as root." >&2
exit 1
fi
SUDO_CFG="/etc/pam.d/sudo"
@robert-saramet
robert-saramet / string_vs_str.rs
Created April 10, 2023 10:48
Comparison between the String and str types in Rust, including example functions and the effects of how the parameters are passed. This is only my understanding as a beginner and I'm not sure everything is correct.
// Idiomatic
// Modifies string_var in place; doesn't return anything
// The original string_var remains valid
fn takes_string_ref_no_return(string_var: &mut String) {
string_var.push_str("world");
}
// Idiomatic
// Returns a new owned String
// The original str_var also remains valid