Skip to content

Instantly share code, notes, and snippets.

View gccore's full-sized avatar

Ghasem Ramezani gccore

View GitHub Profile
@pizlonator
pizlonator / pizlossa.md
Last active October 14, 2025 04:08
Pizlo SSA Form (short version)

Here's a much more complete description of how I do SSA, beyond just how I do Phis.

This describes how I do SSA form, which avoids the need to have any coupling between CFG data structures and SSA data structures.

Let's first define a syntax for SSA and some terminology. Here's an example SSA node:

A = Add(B, C)

In reality, this will be a single object in your in-memory representation, and the names are really addresses of those objects. So, this node has an "implicit variable" called A; it's the variable that is implicitly assigned to when you execute the node. If you then do:

@raysan5
raysan5 / installer_optimization_adventure.md
Last active April 1, 2025 23:10
10x Optimizations! An installer creation adventure!

10x Optimization! An installer creation adventure

Background: creating an installer tool

Lately I've been working on rInstallFriendly v2.0, my simple and easy-to-use tool to create fancy software installers.

rInstallFriendly, some visual_styles

rInstallFriendly v2.0, some of its multiple visual styles available. Style is fully customizable!

@trvswgnr
trvswgnr / compress_video
Last active October 9, 2025 03:29
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
@Moelf
Moelf / numpy_is_absurr.md
Last active January 24, 2024 22:29
Numpy is absurd.

Numpy is absurd

HN Discussion

I always gripe about Python not having useful (i.e. performant and with adoption) built-in array type and Numpy doesn't distinguish "vector of vector" from "matrix", but this still surprised me.

in is actually intersect?

It seems that Numpy uses intersect logic to check a in b:

@MamarezaAlipour
MamarezaAlipour / .clang-format
Last active August 2, 2022 14:59
My C++ Clang Format
BasedOnStyle: LLVM
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'false'
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Left
AlignOperands: 'false'
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
@MamarezaAlipour
MamarezaAlipour / CsharpGetSet.cpp
Created March 7, 2022 11:52
Csharp-Like Properties in C++
#include <iostream>
#include <string>
#define GET_SET(CLASS, NAME, TYPE) \
GetSet<CLASS, TYPE> NAME() { return GetSet<CLASS, TYPE>(this, &CLASS::get_##NAME, &CLASS::set_##NAME); }
#define GET(CLASS, NAME, TYPE) \
Get<CLASS, TYPE> NAME() { return Get<CLASS, TYPE>(this, &CLASS::get_##NAME); }
#define SET(CLASS, NAME, TYPE) \
Set<CLASS, TYPE> NAME() { return Set<CLASS, TYPE>(this, &CLASS::set_##NAME); }
@gorbatschow
gorbatschow / DownsampleLTTB.h
Last active October 30, 2024 14:38
Largest-Triangle-Three-Buckets Downsampling C++
// Largest-Triangle-Three-Buckets algorithm
// SEE
// https://github.com/sveinn-steinarsson/flot-downsample
// https://www.base.is/flot/
// c++ port by gorbatschow.r@gmail.com
template<typename T>
inline void DownsampleLTTB(const T* data_x, const T* data_y, size_t data_length,
T* sampled_x, T* sampled_y, size_t threshold)
{
@Icaruk
Icaruk / multipleGitProfiles.md
Last active September 25, 2025 18:53
How to have multiple profiles on git

Last update: 30-01-2024
Last view: 01-05-2025

Step 1

Go to your work folder, mine is located at: F:/Work/EnterpriseName/

And then create a .gitconfig-work with the following data:

@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a