Skip to content

Instantly share code, notes, and snippets.

View iUltimateLP's full-sized avatar
🏠
Working from home

Johnny iUltimateLP

🏠
Working from home
View GitHub Profile
function hsvToRgb(h, s, v, a)
local r, g, b
local i = math.floor(h * 6);
local f = h * 6 - i;
local p = v * (1 - s);
local q = v * (1 - f * s);
local t = v * (1 - (1 - f) * s);
i = i % 6
@iUltimateLP
iUltimateLP / libwebsocket_client.cpp
Created February 8, 2017 18:13
A simple, minimalistic websocket client using LibWebSocket
// Simple LibWebSockets test client
//////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include "libwebsocket/libwebsockets.h"
@iUltimateLP
iUltimateLP / sinusbot_itunescoverart.js
Last active August 12, 2016 10:48
A simple script to get Album Artwork from iTunes and put it inside the TeamSpeak avatar (using Sinusbot).
registerPlugin
(
{
name: 'iTunes Cover Art',
version: '1.0',
description: 'Download Cover Art from the iTunes API!',
author: 'Johnny Verbeek (iUltimateLP) <iredcraft@gmail.com>',
vars: {
desired_album_size:
{
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "CompressedSaverPrivatePCH.h"
#include "CompressedSaverBPLibrary.h"
UCompressedSaverBPLibrary::UCompressedSaverBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
@iUltimateLP
iUltimateLP / hsv2rgb.hlsl
Created March 4, 2016 14:50
A simple HLSL shader code to convert HSV to RGB colors.
float4 K = float4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
float3 p = abs(frac(input.xxx + K.xyz) * 6.0 - K.www);
return input.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), input.y);
-- Mini game controller for The Talos Principle
-- by iUltimateLP
-- Colors we play with
local colors = {"Red", "Purple", "Yellow",
"Orange", "Lime", "Cyan",
"Gray", "Blue", "Pink",
"Black"}
-- Tries we have, 0 if instant death
local tries = 0
aTexture = new Texture2D(1,1);
aTexture.LoadImage(File.ReadAllBytes(Util.GetModWorkingDir(false, 0) + "/Resources/original/grass.png"));
aTexture.anisoLevel = 8;
bTexture = new Texture2D(1, 1);
bTexture.LoadImage(File.ReadAllBytes(Util.GetModWorkingDir(false, 0) + "/Resources/snow1.png"));
bTexture.anisoLevel = 8;
terMan = FindObjectOfType<TerrainManager>();