Skip to content

Instantly share code, notes, and snippets.

@sebmarkbage
sebmarkbage / The Rules.md
Last active May 13, 2024 06:47
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@mjkstra
mjkstra / arch_linux_installation_guide.md
Last active May 13, 2024 06:43
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@d7samurai
d7samurai / .readme.md
Last active May 13, 2024 06:40
Minimal D3D11 sprite renderer NEO

sponsored by SuperNeo copy 4

Minimal D3D11 sprite renderer NEO

Ultra-compact sprite rendering code with example frame animation logic. This release contains tech bits from the upcoming SuperNeo™ 2D game engine and includes rotation, anchor/pivot point, color filtering, alpha blending and built-in antialiased point sampling. As usual: complete, runnable single-function app. ~150 LOC. No modern C++, OOP or (other) obscuring cruft.

Minimal D3D11 sprite renderer NEO 1337

Sprites are rendered back-to-front (AKA "painter's algorithm") in the order they are submitted, as one draw call. The provided setup employs a single texture atlas containing all the sprite graphics.

The renderer is "im

@gafferongames
gafferongames / delta_compression.cpp
Last active May 13, 2024 06:38
Delta Compression
/*
Delta Compression by Glenn Fiedler.
This source code is placed in the public domain.
http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/
*/
#include <stdint.h>
#include <stdio.h>
#include <assert.h>
#include <string.h>
@charlesaloaye
charlesaloaye / gist:d5234275c8ed0bb4510ffaa9670d80aa
Last active May 13, 2024 06:38
2024 JETBRAINS ACTIVATION CODE | PHPSTORM | PYCHARM | Expires October 14, 2024
I2A0QUY8VU-eyJsaWNlbnNlSWQiOiJJMkEwUVVZOFZVIiwibGljZW5zZWVOYW1lIjoiVU5JVkVSU0lEQURFIEVTVEFEVUFMIERFIENBTVBJTkFTIiwiYXNzaWduZWVOYW1lIjoiVGFvYmFv77yaSkVU5YWo5a625qG25r+AIOa0u+W3peS9nOWupCAgcmVuIHpodW4gZGlhbiBtaW5n77yBIiwiYXNzaWduZWVFbWFpbCI6IlJvYmJ5X1dlbmlnZXJAb3V0bG9vay5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJGb3IgZWR1Y2F0aW9uYWwgdXNlIG9ubHkiLCJjaGVja0NvbmN1cnJlbnRVc2UiOmZhbHNlLCJwcm9kdWN0cyI6W3siY29kZSI6IkRQTiIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiREIiLCJwYWlkVXBUbyI6IjIwMjQtMTAtMTQiLCJleHRlbmRlZCI6ZmFsc2V9LHsiY29kZSI6IlBTIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJJSSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNDIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkdPIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOmZhbHNlfSx7ImNvZGUiOiJETSIsInBhaWRVcFRvIjoiMjAyNC0xMC0xNCIsImV4dGVuZGVkIjpmYWxzZX0seyJjb2RlIjoiUlNGIiwicGFpZFVwVG8iOiIyMDI0LTEwLTE0IiwiZXh0ZW5kZWQiOnRydWV9LHsiY29kZSI6IkRTIiwicGFpZFVwVG8iOiIyMDI0LTEwL
@pvanderwoude
pvanderwoude / Remediate-LocalAdministrators.ps1
Created September 28, 2020 14:02
Remediate-LocalAdministrators
#Define variables
$currentUser = (Get-CimInstance Win32_ComputerSystem).Username -replace '.*\\'
$localAdministrators = @("[YourGlobalAdminRoleSid]","[YourDeviceAdminRoleSid]") #Adjust to your local administrators
try {
$administratorsGroup = ([ADSI]"WinNT://$env:COMPUTERNAME").psbase.children.find("Administrators")
$administratorsGroupMembers = $administratorsGroup.psbase.invoke("Members")
foreach ($administratorsGroupMember in $administratorsGroupMembers) {
$administrator = $administratorsGroupMember.GetType().InvokeMember('Name','GetProperty',$null,$administratorsGroupMember,$null)
if (($administrator -ne "Administrator") -and ($administrator -ne $currentUser)) {
@TaipanRex
TaipanRex / Windows-app-Ranger.md
Last active May 13, 2024 06:38
How to launch Windows applications from Ranger in Windows Subsystem for Linux (WSL)

Make sure you have WSL with the Windows 10 Fall Creators Update installed. Ranger uses rifle as a file handler and you need its config file, rifle.conf. If you dont have it (should be in ~/.config/ranger/rifle.conf), run the command ranger --copy-config=rifle, then edit the resulting file.

To run Windows applications from Ranger, we will use cmd.exe /C start "" <file>, which works after the Fall Creators Update. The problem is that Ranger will feed in file paths using Unix pathing, but start expects Windows pathing. We will solve this by using sed to translate the path.

Add below code to your rifle.conf and you will be able to run Windows applications for the chosen file extensions.

@daemon3000
daemon3000 / TextureToBase64Tool.cs
Last active May 13, 2024 06:36
A tool for Unity that converts a Texture2D object to a Base64 string
#region [Copyright (c) 2015 Cristian Alexandru Geambasu]
// Distributed under the terms of an MIT-style license:
//
// The MIT License
//
// Copyright (c) 2015 Cristian Alexandru Geambasu
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
@omarojo
omarojo / VideoMediaInput.swift
Last active May 13, 2024 06:35
How to use MTAudioProcessingTap in Swift 4.2
//
// VideoMediaInput.swift
// GenerateMetal-iOS
//
// Created by Omar Juarez Ortiz on 2018-11-28.
// Copyright © 2018 All rights reserved.
//
import Foundation
import UIKit

I've recently joined Amazon Dublin from India and got opportunities to interview with Meta London, Zalando Berlin & some other companies. I extensively researched about companies hiring internationally which support visa & relocation for Tech roles. So sharing list of companies:

Do consider to STAR, if it helped you.

London