Skip to content

Instantly share code, notes, and snippets.

View triktron's full-sized avatar
💭
tired

Luca Vanesche triktron

💭
tired
View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<div id=pubnub pub-key=demo sub-key=demo></div>
<script>
(function(){
window.JSON&&window.JSON.stringify||function(){function y(s){F.lastIndex=0;return F.test(s)?'"'+s.replace(F,function(t){var j=J[t];return typeof j==="string"?j:"\\u"+("0000"+t.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+s+'"'}function w(s,t){var j,q,n,z,A=m,o,g=t[s];if(g&&typeof g==="object"&&typeof g.toJSON==="function")g=g.toJSON(s);if(typeof p==="function")g=p.call(t,s,g);switch(typeof g){case "string":return y(g);case "number":return isFinite(g)?String(g):"null";case "boolean":case "null":return String(g);
case "object":if(!g)return"null";m+=r;o=[];if(Object.prototype.toString.apply(g)==="[object Array]"){z=g.length;for(j=0;j<z;j+=1)o[j]=w(j,g)||"null";n=o.length===0?"[]":m?"[\n"+m+o.join(",\n"+m)+"\n"+A+"]":"["+o.join(",")+"]";m=A;return n}if(p&&typeof p==="object"){z=p.length;for(j=0;j<z;j+=1){q=p[j];if(typeof q==="string")if(n=w(q,g))o.push(y(q)
@triktron
triktron / Monstercat_Podcast_Retriever.js
Created July 20, 2017 09:33
this is a small module to get Monstercat podcast tracklist from reddit.
/**
* this is a small module to get Monstercat podcast tracklist from reddit.
*
* I plan to use this to get what track is playing live!
*
* thanks to @thefourtheye https://stackoverflow.com/questions/22581979/how-to-return-only-captured-groups-in-a-javascript-regex-with-multiple-matches
*
* Monstercat and reddit is not mine (obviously)
* Feel free to use this code however you want but be so kind to link me if you use it.
*/
// ==UserScript==
// @name Cookie Clicker auto buying script
// @version 0.1
// @description this scrip will calculate what the best building to buy is, and then buy it. it also buys your upgrades and clicks golden cookies.
// @author Triktron
// @match https://orteil.dashnet.org/cookieclicker/
// @grant none
// ==/UserScript==
function IsReady() {
@triktron
triktron / Monogame Rectangle AABB colision resolver
Last active December 11, 2019 12:24
fixed switched bottom and top
using Microsoft.Xna.Framework;
namespace Colision_Monogame
{
class Colision // based on https://stackoverflow.com/a/46196426/6483652
{
public enum Side
{
Top,
Bottom,
@triktron
triktron / PrioritySystem.cs
Created October 17, 2021 21:17
Priority system
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
namespace Triktron.Utils
{
#if UNITY_EDITOR
using UnityEditor;
@triktron
triktron / M2MQTTWrapper.cs
Last active May 16, 2022 09:51
M2MQTT event based wrapper for Unity
/// Copyright(C) 2022 Triktron, Luca Vanesche <<[email protected]>>
///
/// 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,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the