Skip to content

Instantly share code, notes, and snippets.

View iFeelPixel's full-sized avatar

iFeelPixel

View GitHub Profile
@iFeelPixel
iFeelPixel / valve-data-format-jsonify.php
Created February 22, 2018 20:51 — forked from AlienHoboken/valve-data-format-jsonify.php
This short PHP script will create valid JSON data from Valve Data Format (VDF) data, such as items_game.txt files for TF2 and DotA 2. This allows for much greater ease in parsing the data it contains.
<?php
//load VDF data either from API call or fetching from file/url
//no matter your method, $json must contain the VDF data to be parsed
$json = file_get_contents("items_game.txt");
//encapsulate in braces
$json = "{\n$json\n}";
//replace open braces
$pattern = '/"([^"]*)"(\s*){/';
@iFeelPixel
iFeelPixel / mdJson.bas
Created October 6, 2016 00:25 — forked from wqweto/mdJson.bas
JSON parsing and dumping functions in VB6
Option Explicit
DefObj A-Z
Private Const MODULE_NAME As String = "mdJson"
'=========================================================================
' API
'=========================================================================
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)