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
@Gargaj
Gargaj / stats.py
Last active August 29, 2015 13:57
Block statistics script for MCEdit
# block stats filter for mcedit
# by gargaj
#
# select area, apply filter, receive dialog with exact block stats.
# great for building in creative and then estimating resources for survival
inputs = ()
from albow.dialogs import Dialog
from albow import TableView, TableColumn, Button
@Gargaj
Gargaj / geoip_on_join.mrc
Last active February 28, 2021 00:29
Webchat-to-GeoIP lookup script for mIRC
; Webchat-to-GeoIP lookup script for mIRC
; by Gargaj
Alias geoip {
var %sn geo_
var %r 1
while (%r <= 10) {
var %sn %sn $+ $rand(a,z)
inc %r 1
}
@Gargaj
Gargaj / LUTGenerator.pde
Last active August 29, 2015 14:06
Color grading LUT generator
int block = 32;
void setup() {
size( block * block, block );
}
void draw() {
loadPixels();
int scale = 256 / block;
for (int r=0; r<block; r++)
for (int g=0; g<block; g++)
@Gargaj
Gargaj / VolumeTextureConverter.cpp
Last active August 29, 2015 14:06
2D-to-volume texture converter
#include <Windows.h>
#include <stdio.h>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#define RESWIDTH 320
#define RESHEIGHT 480
@Gargaj
Gargaj / FixChests.cs
Last active August 29, 2015 14:08
MC 1.8 chest fix
using System;
using Substrate;
using Substrate.Core;
class Program
{
static void Main (string[] args)
{
if (args.Length < 1)
{
@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];
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 / 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..."
@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 / 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)))