Skip to content

Instantly share code, notes, and snippets.

View kg's full-sized avatar

Katelyn Gadd kg

View GitHub Profile
public override async Task<bool> Step () {
await WaitForIdle();
if (!CombatState.canAct)
return true;
if (CombatState.turn == 1) {
await Socket.TryClickElement("div.btn-chat.display-on");
await Task.Delay(1000);
function PromiseResolver () {
var self = this;
this.startedWhen = null;
this.resolve = null;
this.reject = null;
this.promise = new Promise(
function (resolve, reject) {
self.resolve = resolve;
self.reject = reject;
(function () {
this.i18n = {
/*
Strings for japanese can be added like so:
"name": {
"en": "Romaji"
},
->
function PromiseResolver () {
var self = this;
this.promise = new Promise(
function (resolve, reject) {
self.resolve = resolve;
self.reject = reject;
}
);
};
@kg
kg / chrome userContent.css
Created May 13, 2016 00:32
mobile twitter userstyle
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain(mobile.twitter.com) {
body {
background-color: rgb(24, 32, 40);
}
nav {
align-items: stretch !important;
}
@kg
kg / xflunpack.cs
Created February 20, 2016 05:11
Liarsoft archive unpacker
using System;
using System.Text;
using System.IO;
using System.Collections.Generic;
public static class Program {
public struct Record {
public string Name;
public int Offset;
public int Size;
@if [%6]==[] goto error
@goto ok
:error
@echo USAGE: video2gif START_TIME DURATION WIDTH FRAME_RATE (DITHER_OPTIONS) (CROP_RECTANGLE width:height:x:y) INPUT OUTPUT
@goto end
:ok
@set PALETTE="%TEMP%\palette.png"
function match (chars, offset, count, callback) {
var capturingFromOffset = false;
for (var i = 0; i < count; i++) {
var ch = chars[offset + i];
if (ch === '\') {
i += 1;
} else if (ch === '{') {
if (capturingFromOffset === false)
capturingFromOffset = i + 1;
// Test output begins here //
<16775168.00, 33550336.00, 50325504.00>
Arrays: 00136.00ms
<16775168.00, 33550336.00, 50325504.00>
ManuallyPackedStructs: 00260.00ms
<16775168.00, 33550336.00, 50325504.00>
PackedStructs: 00242.00ms
<16775168.00, 33550336.00, 50325504.00>
PackedStructPointers: 00244.00ms
<16775168.00, 33550336.00, 50325504.00>
(function() {
// Generated by JSIL v0.8.2 build 32921. See http://jsil.org/ for more information.
'use strict';
var $asm00 = JSIL.GetAssembly("Vector3.cs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null");
var $asm01 = JSIL.GetAssembly("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");
var $asm02 = JSIL.GetAssembly("JSIL.Meta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null");
if (typeof (contentManifest) !== "object") { JSIL.GlobalNamespace.contentManifest = {}; };
contentManifest["Vector3.cs.dll"] = [