Skip to content

Instantly share code, notes, and snippets.

View oyagci's full-sized avatar
🎯
Focusing

Oguzhan Yagci oyagci

🎯
Focusing
View GitHub Profile
@oyagci
oyagci / ComputeGunLead.cs
Created March 24, 2021 19:56 — forked from brihernandez/ComputeGunLead.cs
Computes a point for a gun to aim at in order to hit a target using linear prediction.
/// <summary>
/// Computes a point for a gun to aim at in order to hit a target using linear prediction.
/// Assumes a bullet with no gravity or drag. I.e. A bullet that maintains a constant.
/// velocity after it's been fired.
/// </summary>
public static Vector3 ComputeGunLead(Vector3 targetPos, Vector3 targetVel, Vector3 ownPos, Vector3 ownVel, float muzzleVelocity)
{
// Extremely low muzzle velocities are unlikely to ever hit. This also prevents a
// possible division by zero if the muzzle velocity is zero for whatever reason.
if (muzzleVelocity < 1f)
@oyagci
oyagci / greedyvoxelmeshing.cs
Created December 18, 2019 18:44 — forked from Vercidium/greedyvoxelmeshing
Greedy Voxel Meshing ported to C#
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/
// Note this implemenetation does not support different block types or block normals
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/
const int CHUNK_SIZE = 32;
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0)
/* In Profiles/<your profile/chrome/userChrome.css */
.browserContainer {
background-color: #333 !important;
}
/* In userContent.css */
@-moz-document url-prefix(about:blank), url-prefix(about:newtab) {
html:not(#ublock0-epicker), html:not(#ublock0-epicker) body, #newtab-customize-overlay {
background: #3d3d3d !important;
@oyagci
oyagci / chroot.sh
Created August 7, 2018 07:15 — forked from uglide/chroot.sh
Chroot to Installed system on LVM
#!/bin/bash
fdisk -lu
pvscan
vgscan
vgchange -a y
lvscan
mount /dev/ubuntu-vg/root /mnt
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
@oyagci
oyagci / keybase.md
Last active January 22, 2020 10:03
keybase.md

Keybase proof

I hereby claim:

  • I am oyagci on github.
  • I am oguwan (https://keybase.io/oguwan) on keybase.
  • I have a public key ASA3UML4fJZWHfNiX-YlRYd2KJ7VatS_3UXOgxPvkOnV5wo

To claim this, I am signing this object:

#include <criterion/criterion.h>
#include "ft_malloc.h"
#include <limits.h>
#include <stdio.h>
void *ft_malloc(size_t size);
Test(evaluation, test1)
{
int i;
@oyagci
oyagci / _readme.md
Created January 12, 2018 23:32 — forked from pongstr/_readme.md
ExpressJS: Nested Routing
@oyagci
oyagci / check_leaks.sh
Last active September 25, 2017 09:34
How to check your leaks with a script.
#!/bin/bash
while true
do
a=$(leaks 42sh > /tmp/leakout.txt)
wait $!
clear
cat /tmp/leakout.txt
sleep 0.5
done