Skip to content

Instantly share code, notes, and snippets.

View Sidorakh's full-sized avatar
💭
🐧 Bring the cold!

Andrew Rutherford Sidorakh

💭
🐧 Bring the cold!
View GitHub Profile
@Sidorakh
Sidorakh / json_stringify_fix.gml
Created March 25, 2023 02:40
Fixed version of json_stringify for GM 2023.2.1.90
global.__NEGATIVE_INFINITY = json_parse(@'{"neginf":"@@-infinity$$"}').neginf;
/// @description Stringify JSON
/// @argument {Any} val
/// @argument {Bool} prettify
function json_stringify_fixed(val,prettify=false,firstrun=false) {
static array = function(val,prettify,indent=0) {
var ind = "";
@Sidorakh
Sidorakh / app.js
Last active June 19, 2020 01:15
tcp-hookshot-client.js
const net = require('net');
const rl = require('readline-sync');
const axios = require('axios').default;
(async()=>{
const ip_data = await axios.get('https://hook.redshirt.dev/service/ip');
const {ip, port} = ip_data.data;
const client = net.createConnection({host:ip,port:port});
@Sidorakh
Sidorakh / to_php.js
Created November 5, 2018 02:08
Converts a proper javascript object to something.. probably PHP
// needed this for work, hopefully someoen else can find use for it
function to_php(obj,result_str="",stack=[]) {
if (typeof(obj) != 'object') {
var item = "";
item += stack[0];
for (var i=1;i<stack.length;i++) {
item += `[${stack[i]}]`
}
item += '=';
item += obj;