Skip to content

Instantly share code, notes, and snippets.

@profan
profan / build_wasm.sh
Last active January 17, 2024 08:01 — forked from nobbele/build_wasm.sh
Compatibility shim for combining macroquad with wasm-bindgen.
#!/usr/bin/env bash
set -e
HELP_STRING=$(cat <<- END
usage: build_wasm.sh
Build script for combining a Macroquad project with wasm-bindgen,
allowing integration with the greater wasm-ecosystem.
@profan
profan / hn_anti_commentary.js
Last active February 26, 2022 20:40
HN AntiCommentary
// ==UserScript==
// @name HN AntiCommentary
// @namespace http://tampermonkey.net
// @version 0.4
// @description Removes the comments button on HN.
// @license MIT
// @author profan
// @match https://news.ycombinator.com/news*
// @match https://news.ycombinator.com
// @grant none
@profan
profan / raymath.d
Created May 28, 2020 17:50
raylib-d raymath ffi
module raymath;
import raylib;
extern (C) @nogc nothrow:
//----------------------------------------------------------------------------------
// Module Functions Definition - Vector2 math
//----------------------------------------------------------------------------------
@profan
profan / game.txt
Created April 1, 2019 19:06
flickgame
{"gameLink":"www.flickgame.org","canvasses":[[94,"9",66,"8",92,"9",68,"8",91,"9",69,"8",91,"9",69,"8",95,"9",65,"8",93,"9",67,"8",93,"9",1,"8",1,"9",65,"8",95,"9",65,"8",96,"9",64,"8",95,"9",65,"8",94,"9",66,"8",94,"9",1,"8",1,"9",64,"8",96,"9",64,"8",96,"9",64,"8",96,"9",64,"8",97,"9",63,"8",97,"9",63,"8",97,"9",63,"8",97,"9",63,"8",96,"9",18,"8",25,"1",21,"8",94,"9",2,"8",1,"9",15,"8",32,"1",16,"8",95,"9",1,"8",1,"9",11,"8",37,"1",15,"8",95,"9",2,"8",1,"9",8,"8",39,"1",15,"8",94,"9",10,"8",42,"1",14,"8",93,"9",3,"8",3,"9",6,"8",1,"1",1,"0",35,"1",1,"0",2,"1",1,"0",14,"8",96,"9",9,"8",1,"1",1,"0",1,"1",1,"0",2,"1",3,"0",1,"1",1,"0",25,"1",2,"0",2,"1",1,"0",14,"8",97,"9",8,"8",1,"1",1,"0",1,"1",2,"0",1,"1",2,"0",3,"1",1,"0",17,"1",2,"0",1,"1",3,"0",1,"1",2,"0",2,"1",1,"0",14,"8",96,"9",1,"8",1,"9",7,"8",1,"1",1,"0",1,"1",1,"0",2,"1",2,"0",4,"1",3,"0",1,"1",1,"0",4,"1",1,"0",1,"1",1,"0",1,"1",1,"0",8,"1",1,"0",1,"1",2,"0",2,"1",1,"0",14,"8",95,"9",11,"8",1,"0",1,"1",1,"0",1,"1",1,"0",2,"1",1,"0",3,"1",1,"0",1,
@profan
profan / main.lua
Last active October 2, 2019 23:30
LÖVE thing of ordering points by polar coordinates (for LÖVE 11.2)
local lt = love.timer
local lg = love.graphics
local game = {
points = {}
}
function polar_to_cartesian(r, phi)
local x = r * cos(phi)
local y = r * sin(phi)
@profan
profan / ExtraUtils.cs
Last active January 26, 2019 17:59
Collection of various Xenko utility functions (will stick them all in here as I figured out more that might be useful)
using Xenko.Core.Mathematics;
class ExtraUtils {
public static Vector3 RotateAround(Vector3 p, Vector3 origin, Quaternion rot)
{
var translated = (p - origin);
var rotated = Vector3.Transform(translated, rot);
return rotated + origin;
}
@profan
profan / mm options menu
Created November 10, 2018 23:48
options_menu.gd
extends Control
onready var back_btn = get_node("buttons/center/options_containers/sound_options/back_btn")
onready var audio_player = get_node("audio_player")
# general
onready var reading_speed_slider = get_node("buttons/center/options_containers/general_options/reading_speed_slider")
# desktop only general
onready var resolution_title = get_node("buttons/center/options_containers/general_options/resolution_title")
@profan
profan / app.d
Created October 28, 2018 14:56
terrible message handling loop
import vibe.d;
import vibe.data.json;
import vibe.http.router;
import std.concurrency : spawnLinked, Tid, thisTid;
import orb.net : NetworkClient;
import orb.server : Server;
shared static this() {
@profan
profan / new_flicker_and_glow.gd
Last active September 7, 2018 15:48
newer thing
extends Node2D
const Util = preload("res://util.gd")
const Flickering = Util.Flickering
export(float) var width
export(float) var height
var glow_speed = 0.00125 # per second
export(float) var glow_min_target = 0.425
@profan
profan / flicker_and_glow.gd
Last active September 7, 2018 15:37
flickering rectangle thing
extends Node2D
export(float) var width
export(float) var height
var glow_speed = 0.00125 # per second
export(float) var glow_min_target = 0.425
export(float) var glow_max_target = 0.515
export(float) var glow_mul = 0.05