Skip to content

Instantly share code, notes, and snippets.

@hikipuro
hikipuro / StringFormatter.cs
Last active January 20, 2020 06:06
C#: Partially supported string interpolation (for backward compatibility)
using System.Collections.Generic;
using System.Text.RegularExpressions;
public static class StringFormatter {
/// <summary>
/// How to use:
/// <code>
/// var args = new Dictionary&lt;string, string&gt; {
/// { "test", "def" }
/// };
@hikipuro
hikipuro / ToJson.cs
Last active January 13, 2020 06:47
.NET 4.5: JSON serializer ignore __type property
using System;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.Text;
public class ToJsonSample {
public string ToJson(Type type, object value) {
if (value == null) {
return null;
@hikipuro
hikipuro / webgl_constants.json
Last active January 9, 2021 03:14
WebGL Constants
{
"name": "WebGL Constants",
"url": "https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Constants",
"1": [
{
"functions": [
"WebGLRenderingContext.clear()"
],
"constants": {
// http://qiita.com/sushichop/items/ac4ae99b905ce523c2fe
// https ではなく、 http でアクセスする場合は
// info.plist で設定が必要
// http://qiita.com/peromasamune/items/f5b72c4dbd33b5019611
// http://qiita.com/BurialMound/items/87b8c33e2c7ad767c9dc
// [http自体を許可する手順]
// 1. NSAppTransportSecurity を追加
// 2. その下に NSAllowsArbitraryLoads を追加