Skip to content

Instantly share code, notes, and snippets.

@jamesu
jamesu / main.go
Created October 22, 2021 01:07
Experiment getting gitlab runner to run jobs without gitlab
package main
import (
"fmt"
"net/http"
"log"
"os"
"io/ioutil"
"encoding/json"
b64 "encoding/base64"
// An example of how to bind a C++ class in four scripting languages: lua, squirrel, mruby, and angelscript.
// Written by James S Urquhart ( http://www.cuppadev.co.uk/ ). Feel free to experiment!
#include <stdarg.h>
#include <stdio.h>
#include <assert.h>
// Lua includes
extern "C"
{
##
# Calendar helper with proper events
# http://www.cuppadev.co.uk/webdev/making-a-real-calendar-in-rails/
#
# (C) 2009 James S Urquhart (jamesu at gmail dot com)
# Derived from calendar_helper
# (C) Jeremy Voorhis, Geoffrey Grosenbach, Jarkko Laine, Tom Armitage, Bryan Larsen
# Licensed under MIT. http://www.opensource.org/licenses/mit-license.php
##
@jamesu
jamesu / marble.cpp
Last active November 22, 2020 16:03
marble.cpp
/*
Reverse Engineered MarbleBlast Marble class attempt
TODO: pretty much everything
*/
class MarbleData : public ShapeBaseData
{
private:
typedef ShapeBaseData Parent;
@jamesu
jamesu / dtmf_generate.c
Created August 8, 2012 17:17
Generate DTMF tones
//
// Generate DTMF tones
//
#include <stdio.h>
#include <math.h>
float OutData[44100];
typedef struct ToneInfo {
@jamesu
jamesu / decrypt_onverse.rb
Last active February 1, 2019 21:12
Decrypt Onverse script files
# Decrypts and prints a rudimentary decompilation of onverse script files
# Usage: ruby decrypt_onverse.rb in.cs
#
require 'json'
$is_encrypted = true
def decrypt_data(size, data)
if !$is_encrypted
return data
@jamesu
jamesu / dynamic_css_animations.js
Created March 3, 2010 23:52
How to make dynamic CSS3 animations!
// Creating CSS Animations dynamically
// - jamesu
//
// Assuming:
// - styleSheets[0] is the main stylesheet
// - frames[] is a list of translation,rotation,scale keyframe values
// Note:
// If you modify an existing animation, the old keyframes
// will continue being used until you re-assign the animation.
@jamesu
jamesu / remove_duplicates.sh
Created February 1, 2012 15:37
Remove duplicate emails from an mbox
#!/bin/sh
formail -D 100000000 idcache < $1 -s > $1_new
@jamesu
jamesu / TorqueVisRules.natvis
Created April 3, 2018 16:22
Torque3D vis rules for Visual Studio
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="Vector&lt;*&gt;">
<DisplayString>{{ size={mElementCount} }}</DisplayString>
<Expand>
<Item Name="[size]" ExcludeView="simple">mElementCount</Item>
<Item Name="[capacity]" ExcludeView="simple">mArraySize</Item>
<ArrayItems>
<Size>mElementCount</Size>
<ValuePointer>mArray</ValuePointer>
# Script to generate cryptokitty images using assets from:
# https://github.com/BytesForBites/cryptokitty-designer
# NOTE: requires imagemagick built with --with-librsvg
require 'rubygems'
require 'rmagick'
require 'digest'
class KittyGen