Skip to content

Instantly share code, notes, and snippets.

@svejdo1
svejdo1 / ConvertJsonToBicep.cs
Created September 7, 2023 10:49
Converst json file format to bicep
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Text;
var @object = JObject.Parse(File.ReadAllText(@"C:\temp\swagger.json"));
var stream = new MemoryStream();
using var writer = new CustomizedJsonWriter(new StreamWriter(stream));
writer.QuoteName = false;
writer.Indentation = 4;
@svejdo1
svejdo1 / loader.js
Last active October 10, 2019 19:44
var oFrame = document.createElement("iframe");
oFrame.src = "https://barbar-conan.blogspot.com/2019/10/test.html";
oFrame.onload = function() {
oFrame.contentWindow.postMessage({ msg: 'hi'}, 'https://gist.github.com');
}
document.childNodes[0].childNodes[1].appendChild(oFrame);
@svejdo1
svejdo1 / ProxyXmlWriter.cs
Created February 14, 2017 12:33
Derived fully implemented class of XmlWriter that delegates work on underlying XmlWriter.
public class ProxyXmlWriter : XmlWriter
{
private XmlWriter _writer;
public ProxyXmlWriter(XmlWriter writer)
{
_writer = writer;
}
protected override void Dispose(bool disposing)
@svejdo1
svejdo1 / IsoTexture.cs
Created January 20, 2017 12:07
Simple utility that takes image (where width equals to height) and make isometric tile out of it.
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO;
namespace Barbar.IsoTexture
{
class Program {
static int Main(string[] args) {
using System.Collections.Generic;
using System.IO;
using System.Text;
public class MultiStream : Stream
{
IList<Stream> _streamList = new List<Stream>();
long position = 0;
public override bool CanRead