Skip to content

Instantly share code, notes, and snippets.

View alanedwardes's full-sized avatar
👋

Alan Edwardes alanedwardes

👋
View GitHub Profile
@alanedwardes
alanedwardes / rays.js
Created December 24, 2011 20:53
Generates animated sun rays using HTML canvas
var rays = new Object({
canvas: false,
context: false,
interval: false,
offset: 0,
init: function(id, colour1, colour2){
this.canvas = document.getElementById(id);
this.context = this.canvas.getContext('2d');
this.canvas.style.background = colour1;
this.context.fillStyle = colour2;
@alanedwardes
alanedwardes / EstScreenshotTaker.cpp
Created December 20, 2017 00:11
Unreal Engine 4 class to take and compress screenshots to a JPEG image, then raise an event with the compressed data.
// Estranged is a trade mark of Alan Edwardes.
#include "EstScreenshotTaker.h"
#include "IImageWrapper.h"
#include "IImageWrapperModule.h"
void UEstScreenshotTaker::RequestScreenshot()
{
if (GEngine == nullptr || GEngine->GameViewport == nullptr || bIsScreenshotRequested)
{
@alanedwardes
alanedwardes / create_playlist.py
Created April 20, 2024 23:10
Create a simple .m3u file from a folder heirarchy
import os
import sys
import pathlib
if len(sys.argv) < 2:
print("Error - pass the folder(s) you want to index as argument(s)")
exit(1)
directories = sys.argv[1:]