Skip to content

Instantly share code, notes, and snippets.

View umutseven92's full-sized avatar
Heavily Caffeinated

Umut Seven umutseven92

Heavily Caffeinated
View GitHub Profile
@umutseven92
umutseven92 / gamedev.md
Last active May 5, 2022 09:04
Game Dev Programming

Graphics

Shaders

  • GLSL stands for openGL Shading Language, which is how shaders are written in the OpenGL API.
    • OpenGL is run by Khronos group.
    • OpenGL is a subset of OpenGL that is for embedded systems.
    • Other alternatives are:
      • Direct3D, part of DirectX, owned by Microsoft,
  • Vulkan, next generation OpenGL, also by Khronos group, and,
@umutseven92
umutseven92 / elasticsearch.md
Last active May 13, 2022 10:41
Elasticsearch Cliff Notes

Elasticsearch

Architecture

  • Nodes join a cluster (named elasticsearch by default).
    • One node becomes the master node.
  • Each index data is divided into shards.
    • Internally, an index is a logical namespace that points to one or more shards.
    • 5 shards by default.
  • Due to how routing works, these shards cannot be increased later; you would need to create a new index.
@umutseven92
umutseven92 / search.md
Last active April 26, 2022 10:14
Search Cliff Notes

Search

Learning to Rank

  • Applies supervised machine learning to search relevance ranking.
  • A model is trained based on some preprocessed data.
  • This data with hand-labeled ranks is then used to optimize future results.

Vector Based Search

@umutseven92
umutseven92 / python.md
Last active July 6, 2022 14:02
Python Cliff Notes

Python

How it Works

  • Python code, written in .py file is first compiled to what is called bytecode, which is stored with a .pyc, .pyo or .pyd format.
    • This bytecode is then executed by the interpreter, on instruction at a time.
    • When a module is imported, Python will cache the bytecode of the module as .pyc, .pyo and .pyd files in the __pycache__ folder.
    • .pyc is the bytecode of the module.
    • .pyo is the bytecode of the module if Python is ran with optimisation options (-o and -oo)
  • .pyd is Windows only and is packaged as a DLL.
@umutseven92
umutseven92 / rust.md
Created September 28, 2021 15:28
Rust Cliff Notes

Rust

Data Types

  • The default type is f64 because on modern CPUs it’s roughly the same speed as f32 but is capable of more precision.
  • Declaring arrays: let a: [i32; 5] = [1, 2, 3, 4, 5];
  • isize and usize types depend on the kind of computer your program is running on: 64 bits if you’re on a 64-bit architecture and 32 bits if you’re on a 32-bit architecture.
  • Unlike languages such as Ruby and JavaScript, Rust will not automatically try to convert non-Boolean types to a Boolean.
  • Rust does not have nulls, but it has Option:
@umutseven92
umutseven92 / git-leaks-success
Last active May 10, 2019 00:47
Example of a git-leaks command that runs on a repo with no leaks.
$ gitleaks --repo-path=. -v && git push
INFO[2019-05-10T01:35:23+01:00] opening .
INFO[2019-05-10T01:35:26+01:00] 0 leaks detected. 200 commits inspected in 3 seconds 357 milliseconds
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 289 bytes | 0 bytes/s, done.
@umutseven92
umutseven92 / git-leaks-fail
Last active May 10, 2019 00:48
Example of a git-leaks command that runs on a repo with one leak.
$ gitleaks --repo-path=. -v && git push
INFO[2019-05-10T01:34:24+01:00] opening .
{
"line": "const AWS_KEY = \"AKIALALEMEL33243OLIAE\"",
"commit": "1310d0e0c6d41ff4df89d3bf9fe0cf428932b1eb",
"offender": "AKIALALEMEL33243OLIA",
"reason": "AWS",
"commitMsg": "Add keys ",
"author": "Umut Seven \u003cumutseven92@gmail.com\u003e",
"file": "keys.go",