Skip to content

Instantly share code, notes, and snippets.

わたしは あの路で死んだ花

Ilya 13xforever

わたしは あの路で死んだ花
View GitHub Profile
13xforever / hotspot_conf_decoder.cs
Created Oct 20, 2016
Nintendo Zone hotspot.conf Decoder
View hotspot_conf_decoder.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace hotspot_conf_decoder
class Program
13xforever / KeyValuePair.cs
Last active Dec 18, 2015
KeyValuePair constuction helper
View KeyValuePair.cs
public static class KeyValuePair
public static KeyValuePair<TKey, TValue> Create<TKey, TValue>(TKey key, TValue value)
return new KeyValuePair<TKey, TValue>(key, value);
13xforever / GitInfo.cs
Created Jun 19, 2012
Getting last commit with changes in specified subfolder in git repository
View GitInfo.cs
internal class GitInfo : VcsInfoRetriever
public override VcsInfoData Execute(string localPath)
string relativePath;
var repoPath = FindRepoRoot(localPath, ".git\\index", out relativePath);
if (repoPath == null) return null;
using (var repo = new Repository(repoPath))
13xforever / CastingHelper.cs
Created May 30, 2012
Casting array of bytes to struct and vice versa in C#
View CastingHelper.cs
public static class CastingHelper
public static T CastToStruct<T>(this byte[] data) where T : struct
var pData = GCHandle.Alloc(data, GCHandleType.Pinned);
var result = (T)Marshal.PtrToStructure(pData.AddrOfPinnedObject(), typeof(T));
return result;
13xforever / StringLiteralDecoder.cs
Created Mar 27, 2011
Utility class to decode strings with literals in it
View StringLiteralDecoder.cs
This class should decode everything that is described in Chapter Character literals of C# Language Specification.
See for details.
I actually have test cases in the project in case you wondered, but feel free to test it for yourself.
It's free to use without limitations, but you must not expect any warranty or support for this code either.
13xforever / x.js
Last active Aug 29, 2015
QR-Code generator ubiquity commnd
View x.js
names: ['qr code', 'encode'],
icon: "",
description: "Generates QR Code image based on selected url",
argument: noun_type_url,
preview: function(pBlock, {object}) {
pBlock.innerHTML = '<img src="' + '' + escape(object.text) + '" />';
execute: function(args) {
Utils.openUrlInBrowser('' + escape(args.object.text));
View Full IPv6 Tunnel PoPs list
opkg update
opkg remove dnsmasq
opkg install dnsmasq-full 6in4 tc miniupnpd luci-ssl luci-proto-ipv6 luci-app-upnp uhttpd-mod-tls
rm /etc/config/*-opkg
cp /etc/config/uhttpd.crt /etc/config/
cp /etc/config/uhttpd.key /etc/config/
cp /etc/config/ ~/
View Quickselect.cs
using System.Collections.Generic;
namespace System.Linq.Enumerable
public static class Quickselect
/// <summary>
/// Selects <b>count</b> <i>smallest</i> elements according to a key. Result is returned in no particular order.
/// </summary>
/// <typeparam name="T">Type of elements in collection</typeparam>