Skip to content

Instantly share code, notes, and snippets.

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

Jonathan Verbeek iUltimateLP

🏠
Working from home
View GitHub Profile
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>();
-- 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
@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);
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "CompressedSaverPrivatePCH.h"
#include "CompressedSaverBPLibrary.h"
UCompressedSaverBPLibrary::UCompressedSaverBPLibrary(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
@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) <[email protected]>',
vars: {
desired_album_size:
{
@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"
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
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", "localhost:8080/secure", true);
xmlhttp.setRequestHeader("Authorization", "Basic logout");
xmlhttp.send();
@iUltimateLP
iUltimateLP / steamsdk_lambda_callresults.h
Last active December 19, 2020 19:10
This adds a prototype for a custom CCallResult class which allows you to use lambdas instead of class member functions.
// This is a custom Steam CallResult to support C++ lambdas
//-----------------------------------------------------------------------------
// Purpose: maps a steam async call result to a lambda function
// template params: P = parameter struct
//-----------------------------------------------------------------------------
template<class P>
class CLambdaCallResult : private CCallbackBase
{
public:
typedef void (*func_t)(P*, bool);
@iUltimateLP
iUltimateLP / analog-clock.cc
Last active May 16, 2018 16:24
RGB LED Matrix + Raspberry Pi = Analog Clock
// -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
// Small example how to use the library.
// For more examples, look at demo-main.cc
//
// This code is public domain
// (but note, that the led-matrix library this depends on is GPL v2)
#include "led-matrix.h"
#include <unistd.h>