Skip to content

Instantly share code, notes, and snippets.

View msmshazan's full-sized avatar
💼
Looking for work opportunities

Mohamed Shazan msmshazan

💼
Looking for work opportunities
View GitHub Profile
@mmozeiko
mmozeiko / shader.hlsl
Last active November 7, 2024 20:23
compute shader for rendering monospaced glyphs in grid
//
struct TerminalCell
{
// cell index into GlyphTexture, should be two 16-bit (x,y) values packed: "x | (y << 16)"
uint GlyphIndex;
// 0xAABBGGRR encoded colors, nonzero alpha for Foreground indicates to render colored-glyph
// which means use RGB values from GlyphTexture directly as output, not as ClearType blending weights
uint Foreground;
using System.Runtime.InteropServices;
using System;
public static unsafe class Program
{
[DllImport("kernel32.dll")]
private static extern void* VirtualAlloc(void* addr, int size, int type, int protect);
[DllImport("kernel32.dll")]
private static extern bool VirtualProtect(void* addr, int size, int new_protect, int* old_protect);
[DllImport("kernel32.dll")]
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active May 10, 2025 06:36
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@anuraghazra
anuraghazra / Exclude-node_modules.md
Last active February 16, 2025 21:44
Exclude node_modules folder when copying directory.

Handy Trick To Get Rid Of node_modules

This one is a simple and handy trick when you want to copy your directories without node_modules folder.

Enter this command in your terminal.

robocopy SOURCE DEST /mir /xd node_modules
// --- Library --------------------------------------------------------------------------
#include <string.h>
#include <assert.h>
struct ui_box {int x,y,w,h;};
typedef unsigned long long ui_id;
struct ui_node {
int parent;
int lst, end, nxt;
int siz[2];
@peterneave
peterneave / readme.md
Last active February 11, 2025 04:47
Install pgAgent on Postgres 10 (Debian Linux)

Install pgAgent on Postgres (Debian Linux)

This assumes you will have pgAgent running on the same machine as your database.

Terminal

  1. Install pgAgent via package manager
sudo apt update
@inductor
inductor / install_h2o.sh
Created September 18, 2018 06:50
h2o install on ubuntu 18.04
#!/bin/bash
## apt update && apt upgrade -y && apt autoremove -y
## やろうとしたらlockファイルがあって死んだのでlockファイルを消した
## rm -rf /var/lib/dpkg/lock
apt update && apt upgrade -y && apt autoremove -y
apt -y install locate git cmake build-essential checkinstall autoconf pkg-config libtool python-sphinx wget libcunit1-dev nettle-dev libyaml-dev libuv-dev libssl-dev zlib1g-dev
git clone https://github.com/tatsuhiro-t/wslay.git
git clone https://github.com/h2o/h2o.git
cd wslay/
autoreconf -i
@fay59
fay59 / Quirks of C.md
Last active April 3, 2025 02:27
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active April 30, 2025 12:33
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@ad8e
ad8e / glfw_ship.cpp
Last active April 29, 2025 08:32
instructions to use skia and glfw together. (download, installation, first program). as of Sept 2023, Windows is broken but this is still sadly the best starting resource for skia on Windows too.
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain).
* Copyright 2015 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
The official instructions don't work well. These alternative instructions are intended to be the shortest path to get a minimal setup running.