Skip to content

Instantly share code, notes, and snippets.

@acamino
acamino / README.md
Last active May 20, 2024 22:11
Shortcuts to Improve Your Bash & Zsh Productivity

Shortcut — Action

  • CTRL + A — Move to the beginning of the line
  • CTRL + E — Move to the end of the line
  • CTRL + [left arrow] — Move one word backward (on some systems this is ALT + B)
  • CTRL + [right arrow] — Move one word forward (on some systems this is ALT + F)
  • CTRL + U — (bash) Clear the characters on the line before the current cursor position
  • CTRL + U —(zsh) If you're using the zsh, this will clear the entire line
  • CTRL + K — Clear the characters on the line after the current cursor position
  • ESC + [backspace] — Delete the word in front of the cursor
@cmdr2
cmdr2 / Math3d.cs
Created November 11, 2021 07:34
Useful 3D math functions from the old Unity 3D wiki (which has been shut down). Source: the archived version from July, 2021 at https://web.archive.org/web/20210507045029/https://wiki.unity3d.com/index.php/3d_Math_functions
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System;
public class Math3d {
private static Transform tempChild = null;
private static Transform tempParent = null;
@jdupuy
jdupuy / SampleVndf_GGX.cpp
Last active May 20, 2024 22:00
Sampling Visible GGX Normals with Spherical Caps
// Helper function: sample the visible hemisphere from a spherical cap
vec3 SampleVndf_Hemisphere(vec2 u, vec3 wi)
{
// sample a spherical cap in (-wi.z, 1]
float phi = 2.0f * M_PI * u.x;
float z = fma((1.0f - u.y), (1.0f + wi.z), -wi.z);
float sinTheta = sqrt(clamp(1.0f - z * z, 0.0f, 1.0f));
float x = sinTheta * cos(phi);
float y = sinTheta * sin(phi);
vec3 c = vec3(x, y, z);

Introduction

EigenLayer introduces the possibility of re-using ethereum consensus, and IMO the most interesting usecase for that would be building a decentralized two-way and security-optimal bridge between Bitcoin and Ethereum.

All bridges rely on the security of the two chains they connect and the security of the custodian^[1] used for bridging, since if the security of any of those 3 were to fail, it would be possible to drain the bridge (eg: if its possible to double-spend on any of the two chains an attacker can redeem the same coin multiple times).

However, if a significant amount of the total ETH staked were to be restaked securing this bridge, the custodian would be piggybacking on ethereum security, so those two become the same and thus you'd remove the custodian from your list of dependencies and you're left with only having to depend on the security of the two chains, which is the theoretical ceiling of security. In other words, you'd achieve the best possible security.

But not just that, you

@qoomon
qoomon / conventional_commit_messages.md
Last active May 20, 2024 22:00
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@Fuwn
Fuwn / xp.md
Last active May 20, 2024 21:59
Windows XP All Editions Universal Product Keys Collection.

Although Microsoft does not support Windows XP updates any more, I’m sure there are still many users using it due to their personal habits or job demands. Therefore XP’s product keys may be necessary even now, and Fuwn provided you with the most comprehensive Windows XP product keys here, just in order to provide some convenience.

The following CD-KEYs are official and original from Microsoft, mainly used for Windows XP Professional Service Pack 2/3 VOL/VLK system images which are the easiest ones to find on the Internet. Their biggest advantage is your Windows XP will be activated after using these CD-KEYs to complete installation.

// Windows XP Pro Product Keys //

@natefoo
natefoo / 00README.md
Last active May 20, 2024 21:55
Linux Distribution Detection

Distribution Detection

I am working on adding support for building and distributing (via PyPI) Python Wheels with C Extensions to the Python wheel and pip packages. The discussion on Distutils-SIG continues, but I believe it is fairly certain that some effort to correctly identify Linux distributions will need to be made. I've begun efforts to add this support to wheel.

How you can help

If you have a Linux distribution or version of a listed distribution not in this gist, or one of the ones I have not directly verified, I could use the following:

  • The contents of /etc/os-release, if it exists
@migasj
migasj / WindowsSystemErrorCodes.cs
Last active May 20, 2024 21:53
Windows System Error Codes enum (C#)
// Title: An exhaustive enum of all Windows System Error Codes
// Source: https://msdn.microsoft.com/en-us/library/windows/desktop/ms681381.aspx
// Description: Error codes are a means to provide information to outside systems on why a program terminated. This list
// need not be included in its entirety. It is meant to aid in conforming to the existing error code usage.
// See this link form more information on usage. https://msdn.microsoft.com/en-us/library/system.environment.exitcode.aspx
// Note: Internet error codes are excluded from this list. See here: https://msdn.microsoft.com/en-us/library/windows/desktop/aa385465.aspx
// Updated: 2016/10/31
namespace Core
{