Skip to content

Instantly share code, notes, and snippets.

View gokselgoktas's full-sized avatar
🐰

Göksel Göktas gokselgoktas

🐰
View GitHub Profile
@gokselgoktas
gokselgoktas / spotify-reversed-binary-numbers.c
Last active December 24, 2015 20:39
This Gist solves the problem specified at: https://www.spotify.com/fi/jobs/tech/reversed-binary/ Unlike most of its counterparts this one runs in constant-time and makes explicit use of bit-hacks and intrinsics (whenever possible).
#include <stdlib.h>
#include <stdio.h>
static inline unsigned int reverse_bits(register unsigned int number)
{
register unsigned int shift = __builtin_clz(number);
number = (((number & 0xAAAAAAAA) >> 0x01) |
((number & 0x55555555) << 0x01));
const highp float EPSILON = .01;
const highp float AMBIENT_OCCLUSION_SAMPLE_DISTANCE = .05;
const highp float SHADOW_SAMPLE_DISTANCE = .25;
int MATERIAL_ID = 0;
mediump float ITERATION_COUNT = 0.;
highp float sample_and_update_material_id(highp vec3 position)
{
highp float sphere_1 = length(position - vec3(-3., 0., 0.)) - 3.5;
@gokselgoktas
gokselgoktas / csgo-autoexec.cfg
Last active July 7, 2017 12:56
The autoexec.cfg script I use in Counter-Strike: Global Offensive
clear
developer 1
con_enable 1
rate 128000
cl_cmdrate 128
cl_updaterate 128
@gokselgoktas
gokselgoktas / profile.ps1
Last active April 30, 2024 14:51
A custom PowerShell profile
$env:LC_ALL = 'C.UTF-8'
Set-Location D:
function Import-VisualStudio () {
$installationPath = & "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe" `
-property installationPath
Import-Module (Join-Path $installationPath "Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll")