Skip to content

Instantly share code, notes, and snippets.

public byte[] GetRootFile ()
{
try
{
StreamReader reader = new StreamReader (root + "index.html");
string RootFile = reader.ReadToEnd ();
reader.Close ();
string ReplaceString = "&nbsp;&nbsp;&nbsp;&nbsp;Root<br/>";
string[] Directories = Directory.GetDirectories (root, "*", SearchOption.AllDirectories);
@SplittyDev
SplittyDev / DriverPool
Created January 2, 2014 19:35
DriverPool class
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SplitsysOS_Source.Drivers
{
public static class DriverPool
{
@SplittyDev
SplittyDev / ACPI_Driver.cs
Last active April 27, 2018 06:28
The ACPI driver
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using IO = SplitsysOS_Source.Core.PortIO;
namespace SplitsysOS_Source.Drivers
{
@SplittyDev
SplittyDev / gist:613dc34e264b8bf77ac7
Last active August 29, 2015 14:09
Linq Extension Each
using System;
// Stable
namespace System.Linq
{
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public static class LinqExtensions
@SplittyDev
SplittyDev / gist:13b0bc01971f6f4eff81
Created May 10, 2015 23:32
Read password from stdin
public static string ReadPassword () {
const char PLACEHOLDER = '*';
var accum = new StringBuilder ();
while (true) {
var key = Console.ReadKey (true);
if (key.Key == ConsoleKey.Backspace) {
if (accum.Length > 0) {
accum.Remove (accum.Length - 1, 1);
Console.Write ("\b \b");
}
@SplittyDev
SplittyDev / ezrest.php
Last active August 12, 2016 10:47
ezrest
<?php
// Predefined actions
function emit_empty_200 ($params) {
// 200 OK
http_response_code (200);
return array ();
}
function emit_empty_404 ($params) {
@SplittyDev
SplittyDev / fchippy.fs
Last active September 30, 2015 12:10
WIP F# CHIP8 emulator
// The virtual screen width
let SCREEN_WIDTH = 64
// The virtual screen height
let SCREEN_HEIGHT = 32
// The CHIP8 font map
let font : byte array =
[| 0xF0uy; 0x90uy; 0x90uy; 0x90uy; 0xF0uy;
0x20uy; 0x60uy; 0x20uy; 0x20uy; 0x70uy;
using System;
using Iodine.Runtime;
using nginz.Common;
namespace nginz.Interop.Iodine.nginzcore
{
public class GLBufferType : IodineObject, ICanLog
{
readonly static IodineTypeDefinition typeDef;
@SplittyDev
SplittyDev / WhirlpoolCryptoServiceProvider.cs
Last active October 9, 2021 12:24
Public domain Whirlpool implementation in C#
using System;
using System.Text;
namespace System.Security.Cryptography
{
public class WhirlpoolCryptoServiceProvider : HashAlgorithm
{
#region Constants
const int R = 10;
var crypto = require('crypto')
var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
function nextRand (lower, upper) {
'use strict'
return Math.floor(Math.random() * (upper - lower + 1) + lower)
}
function generateId () {
'use strict'