Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View galek's full-sized avatar
🧭
I'm ready for new discoveries

Nikolay Galko galek

🧭
I'm ready for new discoveries
View GitHub Profile
@galek
galek / pbr.glsl
Created November 4, 2015 11:10
PBR GLSL SHADER
in vec2 v_texcoord; // texture coords
in vec3 v_normal; // normal
in vec3 v_binormal; // binormal (for TBN basis calc)
in vec3 v_pos; // pixel view space position
out vec4 color;
layout(std140) uniform Transforms
{
mat4x4 world_matrix; // object's world position
@galek
galek / gihtubpage.conf
Created November 1, 2020 23:26 — forked from taddev/gihtubpage.conf
NGINX Reverse proxy settings to Github pages
server {
listen 80 default_server;
listen [::]:80 ipv6only=on default_server;
server_name splunk.net blog.splunk.net www.splunk.net .taddevries.com;
access_log /var/log/nginx/blog.access_log main;
error_log /var/log/nginx/blog.error_log info;
return 301 https://blog.splunk.net;
}
server {
@galek
galek / gist:bd1e38e03022ada4b1ef
Created May 14, 2015 22:36
manacher algorithm linear time longest palindromic substring
//Based on http://www.geeksforgeeks.org/manachers-algorithm-linear-time-longest-palindromic-substring-part-4/
// A C program to implement Manacher’s Algorithm
#include <stdio.h>
#include <string.h>
char text[100];
int min(int a, int b)
{
int res = a;
if (b < a)
@galek
galek / microshift-istio.md
Created June 24, 2023 21:37 — forked from tosin2013/microshift-istio.md
Run isitio on microshift

Install istio on mircoshift

You can find the installation instuctions in the link below.

Add metrics server components

kubectl apply -f https://raw.githubusercontent.com/redhat-et/ushift-workload/master/metrics-server/metrics-components.yaml
@galek
galek / PseudoORM.ts
Created April 5, 2023 12:52
PseudoORMInterface for microservices
export abstract class PseudoORMInterface {
getDataFromTable<T1, T2>(TableName: string, valuesKeysForGetting: string[], conditions?: string[] | null): T1;
insertDataToTable(TableName: string);
updateDataToTable<T2>(Data:T2, TableName: string, conditions?: string[] | null): boolean;
deleteDataFromTable(TableName: string, conditions?: string[] | null);
}
export class PseudoORMImpl implements PseudoORMInterface {
@galek
galek / gist:d103a568c0b71fe5b74e42a7d4a28550
Created May 7, 2016 22:08 — forked from Novum/gist:1272928
world position from depth buffer value
// Reconstruct worldspace depth value from z/w depth buffer
float depth = -(z_near * z_far) / (zbuffer_depth * (z_far - z_near) - z_far);
// Compute screenspace coordinate of pixel
float2 screenspace = (float2(pixel.xy) / float2(viewport_size.xy)) * 2.0f - 1.0f;
// Get direction of ray from camera through pixel
float3 ray_direction = normalize(camera_forward + camera_right * screenspace.x - camera_up * screenspace.y);
// Reconstruct world position from depth: depth in z buffer is distance to picture plane, not camera
@galek
galek / Tree_Gen.ms
Last active March 24, 2022 14:55 — forked from bagobor/Tree_Gen.ms
TreeGen for 3DSMax written by Ryan James Smith aka "Virtuosic" on polycount forums.
/*
TreeGen for 3DSMax written by Ryan James Smith aka "Virtuosic" on polycount forums.
This is creative commons, edit and redistribute as you please, just remember to give original credit
also, if you add some cool stuff, email me at virtuosicrjs@gmail.com and let me know what you did so
i can be jealous i didn't think of it... Oh, and if you add something cool, sign your name below mine :D
*/
@galek
galek / add_intellij_launcer
Created May 21, 2021 20:05 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
@galek
galek / media-query.css
Created October 26, 2020 05:26 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@galek
galek / media-query.css
Created October 26, 2020 05:26 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS