Skip to content

Instantly share code, notes, and snippets.

View JLChnToZ's full-sized avatar
🥽
From game to XR experience

Jeremy Lam aka. Vistanz JLChnToZ

🥽
From game to XR experience
View GitHub Profile
@JLChnToZ
JLChnToZ / Game1.cs
Created August 13, 2013 07:27
Burn the falling pork game (Kinect ver.) source code (messy stuff)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Kinect;
using libZPlay;
@JLChnToZ
JLChnToZ / SGL.js
Last active September 21, 2018 14:12
Osu! Storyboard Generation Language (SGL) in pure JavaScript implementation. The code has assumed the interpreter has a print function defined as "print(text)". Reference: http://moonshadow.hostbeef.com/sgl/ and http://osu.ppy.sh/wiki/Storyboard_Scripting
/**
Osu! Storyboard Generation Language (SGL) in pure JavaScript implementaion
Copyright (C) 2013, Jeremy Lam [JLChnToZ]
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
@JLChnToZ
JLChnToZ / mmlbeep.cpp
Last active December 16, 2017 13:00
"MML Beep" -- Plays MML (Music Macro Language) sequence in BEEP sound with motherboard buzzer.
/*
*
* MML BEEP Ver 1.0
* Plays MML sequence in BEEP sound.
* Copyright (C) 2011, Jeremy Lam.
* http://explosivetheormlab.wordpress.com
*
* It is free to use any part of this program anywhere you want. But only thing
* I want is put my name into your program's credits which is used part of this
* program (Jeremy Lam or JLChnToZ, both name are OK, it is better to put my
MCFormatToHTML = (src) ->
src = src.replace /&/g, "&"
src = src.replace /</g, "&lt;"
src = src.replace />/g, "&gt;"
src = src.replace /"/g, "&quot;"
src = src.replace /\s/, "&nbsp;"
src = src.replace /\n/, "<br />"
colors = ["000", "00A", "0A0", "0AA", "A00", "A0A", "FA0", "AAA", "555", "55F", "5F5", "5FF", "F55", "F5F", "FF5", "FFF"]
shadowColors = ["000000", "00002A", "002A00", "002A2A", "2A0000", "2A002A", "2A2A00", "2A2A2A", "151515", "15153F", "153F15", "153F3F", "3F1515", "3F153F", "3F3F15", "3F3F3F"]
color = "000"
@JLChnToZ
JLChnToZ / Christmas.xml
Last active August 29, 2015 14:01
Sample file for block editor test. (http://gh.jlctz.tk/BlockEditorTest/)
<xml>
<block type="variables_set" id="44" inline="false" x="86" y="30">
<field name="VAR">a</field>
<value name="VALUE">
<block type="math_number" id="63">
<field name="NUM">0</field>
</block>
</value>
<next>
<block type="variables_set" id="102" inline="false">
@JLChnToZ
JLChnToZ / json.php
Last active April 7, 2022 19:26
Minecraft Server Status Ping/Query Ajax/JSON interface.
<?php
// Grab server status and return as JSON format...
// This simple script is written by Jeremy Lam (JLChnToZ).
// Usage http://www.example.com/link/to/json.php/192.168.1.101:25565/ping/legacy_ping
// Requet it as usual file, first provide the server IP/host name and port, then is the request type.
// For what kind of json data will it return, I suggest to read the description in the mcstat.php
// as all data is wrap in there, the only thing what the script below doing is just repacking the reqult to JSON.
// mcstat.php is required for using this script
// Download from here: https://github.com/winny-/mcstat/blob/master/mcstat.php
@JLChnToZ
JLChnToZ / compare.coffee
Last active August 29, 2015 14:03
Deep compare 2 JavaScript objects
compare = (->
compareByType =
"array": (a, b) ->
return false if a.length isnt b.length
return false for i in [0...a.length] when not equals a[i], b[i]
true
"object": (a, b) ->
return false for i of a when not (b.hasOwnProperty i) or not equals a[i], b[i]
return false for i of b when not a.hasOwnProperty i
@JLChnToZ
JLChnToZ / mccolor.coffee
Last active August 29, 2015 14:03
Minecraft Color Formatting JQuery Plugin (Supports debug console too)
# Minecraft Color Formatting JQuery Plugin
# (c) JLChnToZ 2014
(($) ->
MCColors = [
0, 10, 160, 170
2560, 2570, 4000, 2730
1365, 1375, 1525, 1535
3925, 3935, 4085, 4095
]
rndstr = (len, chars) ->
@JLChnToZ
JLChnToZ / beats.js
Created August 17, 2014 18:19
Swatch Internet Time in JavaScript
Date.prototype.getBeats = function() {
return (this / 864e2 + 1e3 / 24) % 1e3;
};
@JLChnToZ
JLChnToZ / misc.coffee
Last active August 29, 2015 14:06
I don't know when it will be used, but just write it out...
Object::seek = (tree) ->
tree = tree() if typeof tree is "function"
tree = tree.split "." if typeof tree is "string"
tree = [tree] unless tree instanceof Array
iterate = @
iterate = iterate[i] for i in tree
iterate
Object::override = (tree, newStuff, noExec) ->
tree = tree() if typeof tree is "function"