Skip to content

Instantly share code, notes, and snippets.

View Antosser's full-sized avatar

Anton Aparin Antosser

View GitHub Profile
@983
983 / frag.glsl
Created November 14, 2015 09:39
hsv rgb conversion glsl shader
// because http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl is often down
vec3 rgb2hsv(vec3 c)
{
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
float d = q.x - min(q.w, q.y);
float e = 1.0e-10;
@supernlogn
supernlogn / nvidia-power-log.py
Last active November 2, 2023 07:13
An example of logging nvidia gpu power consumption using python.
""" Descr:
A how-to log power consumption of nvidia gpus in a system using python.
After obtaining results, user can plot them using matplotlib.
author:
Ioannis Athanasiadis (supernlogn)
"""
import numpy as np
from matplotlib import pyplot as plt
import subprocess
import time, datetime
@creikey
creikey / top-1000-nouns.txt
Created December 30, 2019 17:25
Top 1000 English Nouns
time
way
year
work
government
day
man
world
life
part