Skip to content

Instantly share code, notes, and snippets.

@zer0k-z
zer0k-z / rampbugfix.md
Created April 3, 2024 23:27
CS2KZ's rampbug fix

Introduction

In CS2, when a player is sliding/surfing against some geometry, it's possible that they lose all their momentum/velocity. This is usually called wallbug/rampbug. While the name was inherited from Source 1 games (such as CS:GO, CS:S, TF2,...), rampbugs in CS2 behave much differently from its predecessor. In contrast to source 1 games, it's also possible have the velocity redirected to another direction instead of losing all momentum.

This bug doesn't seem to be common in all source 2 games (HL:A for instance, does not have this bug), and was orignially not present in the very early versions of CS2 Limited Test. Rampbugs become more and more frequent over time, with the Call to Arms update effectively doubling the frequency of these bugs, which is a significant problem for custom gamemodes heavily depending on geometry collision (eg. surf).

Keep in mind that while the player collision hitbox is a box, the images shown below will represent the player as a dot instead for simplicity.

Observati

@denji
denji / nginx-tuning.md
Last active April 20, 2024 13:14
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@kohya-ss
kohya-ss / gradio_llm.py
Last active April 20, 2024 13:13
gradioでLLMを利用する簡易クライアント
# Apache License 2.0
# 使用法は gist のコメントを見てください
import argparse
from typing import List, Optional, Union, Iterator
from llama_cpp.llama_chat_format import _convert_completion_to_chat, register_chat_completion_handler
import llama_cpp.llama_types as llama_types
from llama_cpp.llama import LogitsProcessorList, LlamaGrammar
from llama_cpp import Llama, llama_chat_format
import gradio as gr
@jamesr2323
jamesr2323 / rmse_loss.py
Created May 9, 2018 02:40
How to use RMSE loss function in PyTorch
# Thanks https://discuss.pytorch.org/t/rmse-loss-function/16540
class RMSELoss(torch.nn.Module):
def __init__(self):
super(RMSELoss,self).__init__()
def forward(self,x,y):
criterion = nn.MSELoss()
loss = torch.sqrt(criterion(x, y))
return loss
@throwaway96
throwaway96 / crashd.md
Last active April 20, 2024 13:12
crashd instructions

News

Important: Dev Mode app patch and alternatives (2024-04-14)

Since approximately 2024-04-02, the latest LG Dev Mode app (2.1.2 in the Content Store) copies and resets the permissions of jail_app.conf/jail_app.conf.sig on every boot. Therefore, jailpatch.sh etc. will no longer work.

If you have webOS 5+ and old enough firmware, WTA (which does not require Dev Mode) will still work.

If you have webOS 4.x, you can try CVE-2023-6319. It is unpatched on the latest (final?) firmware for webOS 4.0 (2018) models.

@ryanwinchester
ryanwinchester / keymap.jsonc
Created April 20, 2024 12:56
Zed keymap working on my vim stuff
[
// -----------------------------------------------------------------------
// Vim keybindings
// -----------------------------------------------------------------------
{
// NORMAL and VISUAL modes
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
// Tab things. Almost as good as harpoon.
"space 1": ["pane::ActivateItem", 0],
@iRajatDas
iRajatDas / HowToDeleteAllCloudflareRecors.md
Created November 20, 2022 14:51 — forked from AidasK/HowToDeleteAllCloudflareRecors.md
Cloudflare delete all DNS records. Just go to cloudflare dns zones, open your browers developer console and paste this javascript code.

image

Real developers are not used to clicking, it's allways easier to write a script to do it for you.
@gcatlin
gcatlin / sdl-metal-example.m
Last active April 20, 2024 13:04
Minimal C SDL2 Metal example
//
// cc sdl-metal-example.m `sdl2-config --cflags --libs` -framework Metal -framework QuartzCore && ./a.out
//
#include <SDL.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
int main (int argc, char *args[])
{
SDL_SetHint(SDL_HINT_RENDER_DRIVER, "metal");
@danielpquinn
danielpquinn / svg-rounded-rectangle-path.js
Last active April 20, 2024 13:04
Draw SVG Rounded Rectangle Path
/**
* Get path data for a rounded rectangle. Allows for different radius on each corner.
* @param {Number} w Width of rounded rectangle
* @param {Number} h Height of rounded rectangle
* @param {Number} tlr Top left corner radius
* @param {Number} trr Top right corner radius
* @param {Number} brr Bottom right corner radius
* @param {Number} blr Bottom left corner radius
* @return {String} Rounded rectangle SVG path data
*/