Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am andyleap on github.
  • I am vendan (https://keybase.io/vendan) on keybase.
  • I have a public key whose fingerprint is ED99 1AFC 940F F825 2F0B DD66 66B8 D610 4E27 4452

To claim this, I am signing this object:

@andyleap
andyleap / Bookmarklet
Last active August 29, 2015 14:10
screeps console history
javascript: $(function(){ace.edit($("div.ace_editor")[0]).commands.addCommand({name:"saveFile",bindKey:{win:"Ctrl-S",mac:"Command-S",sender:"editor|cli"},exec:function(a,b,c){$("div.controls button.submit").click()}});});
@andyleap
andyleap / parser.go
Created December 2, 2014 04:42
Parser Combinator
package main
import (
"fmt"
"io"
"strings"
"regexp"
"reflect"
)
package arrayslice
import "testing"
func BenchmarkArray8for(b *testing.B) {
var a [8]int
for i := 0 ; i < b.N ; i++ {
for j := 0 ; j < len(a) ; j++ {
a[j] += j
}
<?xml version="1.0" encoding="utf-8"?>
<Definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CategoryClasses>
<Category xsi:type="MyObjectBuilder_GuiBlockCategoryDefinition">
<Id>
<TypeId>GuiBlockCategoryDefinition</TypeId>
<SubtypeId/>
</Id>
<DisplayName>DisplayName_Category_LargeBlocks</DisplayName>
<Name>LargeBlocks</Name>

EEPROM

Device Description

An EEPROM that can be built into various devices to store supplementary data. Holds 8 words, that can only be read or written a single word at a time.

Interrupt Commands

@andyleap
andyleap / gemu.go
Created November 29, 2016 15:23
Gemu Go protocol handler
type PacketType uint16
const (
PacketClassList PacketType = 0x0001
PacketClassListResponse = 0x8001
PacketCreateDT = 0x0101
PacketCreateDTResponse = 0x8101
PacketDeleteDT = 0x0102
PacketDeleteDTResponse = 0x8102
PacketAttachDTDevice = 0x0103
// Implements lzstring with the intention of receiving compressed output from a webpage.
// Most easily made in javascript using a Uint16Array
package main
import (
"bytes"
"encoding/binary"
"fmt"
"io"
"math"
@andyleap
andyleap / gist:04e28138c1dbea032bd068e749e3b06e
Created January 7, 2017 15:57
Attribute based detouring
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using UnityEngine;
using Verse;
namespace RimLib
{
@andyleap
andyleap / main.go
Created March 11, 2017 23:24
Simple RPC system!
package main
import (
"fmt"
"rpctest/client"
)
func main() {
fmt.Println(rpctest.Add(1, 2))
}