Skip to content

Instantly share code, notes, and snippets.

View Gargaj's full-sized avatar
🛁
If you hard. Then you hard.

Gargaj

🛁
If you hard. Then you hard.
View GitHub Profile
#
# TIC80 packer
#
# Uses the zlib code chunk to crunch down your source
# https://github.com/nesbox/TIC-80/wiki/tic-File-Format
#
# Usage: tic80packer [lua file]
#
import sys
/*
Uses https://github.com/datalust/superpower
Usage:
var text = System.IO.File.ReadAllText("visuals.comp");
var parsed = FusionCompParser.ParseComp(text);
var tools = parsed.Get<FusionCompParser.FusionArray>("Tools");
*/
using Superpower;
#version 410 core
uniform float fGlobalTime; // in seconds
uniform vec2 v2Resolution; // viewport resolution (in pixels)
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients
uniform sampler1D texFFTIntegrated; // this is continually increasing
uniform sampler2D texChecker;
uniform sampler2D texNoise;
@Gargaj
Gargaj / pm2-downloader.php
Last active August 31, 2015 12:32
Automatic downloading and sorting script for Partymeister 2 download pages
<?php
include_once("simple_html_dom.php"); // http://simplehtmldom.sourceforge.net
set_time_limit(0);
$rootURL = "http://chaosconstructions.ru/";
$mainURL = $rootURL . "en/results";
$html = file_get_html($mainURL);
@Gargaj
Gargaj / ImageUpload.js
Last active August 29, 2015 14:23
Multiple image upload with drag-and-drop
/*
Requires Prototype
Usage:
var upload = new ImageUpload({
dropElement: $('image-container'),
onFinished: function(){ alert("YAY") }, // optional
uploaderURL: "./upload.php", // optional; if not specified, location.href.
});
upload.startUpload({ someParam: 12345 });
@Gargaj
Gargaj / rage-unpacker.php
Created June 3, 2015 06:28
Data extractor for the Rage demos "Reanim8r" and "Robotnik"
<?php
function unpackR8($data)
{
$ret = "";
for ($x = 0; $x < strlen($data);)
{
$control = ord($data{$x++});
for ($bit = 0; $bit < 8; $bit++)
{
if (!($control & (1 << $bit)))
@Gargaj
Gargaj / roman-numerals.php
Last active August 29, 2015 14:19
Is this the shortest way to convert to roman numerals? I think so.
<?php
// i woke up this morning with the
// odd thought that i want to
// find out what's the most optimal
// way to spell out an integer as
// roman numerals is.
function romanChar(&$num,$value,$code)
{
$r = "";
while($num >= $value)
@Gargaj
Gargaj / wuhu-install.sh
Last active April 3, 2024 01:00
Install script for Wuhu (tested on Debian)
#!/bin/bash
# install script for http://wuhu.function.hu/
if [ "$EUID" -ne 0 ]
then
echo "[wuhu] ERROR: This script needs to install a bunch of things, so please run as root"
exit
fi
echo "[wuhu] Installing packages..."
function Cue(albumArtist, title, tracks) {
this.PERFORMER = albumArtist;
this.TITLE = title;
this.TRACKS = tracks;
};
function Track(trackNumber, artist, title, offset) {
this.TRACK = trackNumber + ' AUDIO';
this.TITLE = title;
@Gargaj
Gargaj / cssb64ifier.php
Last active August 29, 2015 14:14
Script to convert small images into inline base64 in CSS
<?
$inputFile = "";
$outputFile = "";
$sizeLimit = 10 * 1024;
for ($x = 1; $x<count($argv); $x++) {
switch ($argv[$x]) {
case "--output":
case "-o":
{
$outputFile = $argv[++$x];