Skip to content

Instantly share code, notes, and snippets.

View chrahunt's full-sized avatar

Chris Hunt chrahunt

View GitHub Profile
@chrahunt
chrahunt / background.js
Created March 5, 2015 01:38
Chrome extension for testing chrome.storage.local.
(function(window, document, undefined) {
var Storage = {};
window.Storage = Storage;
Storage.tracking = true;
Storage.track = function() {
Storage.tracking = !Storage.tracking;
if (Storage.tracking) {
console.log("Tracking storage performance.");
@chrahunt
chrahunt / se-image-paste.user.js
Last active December 30, 2021 11:50
Add image-pasting capability to StackEdit markdown editor.
// ==UserScript==
// @name StackEdit Image Extension
// @namespace http://chri.sh/
// @version 0.4.1
// @description Add image-pasting capability to StackEdit editor.
// @author chrahunt
// @match https://stackedit.io/editor
// @run-at document-end
// @grant none
// @downloadURL https://gist.github.com/chrahunt/c27686b095a390c26ff8/raw/se-image-paste.user.js
@chrahunt
chrahunt / README.md
Last active September 10, 2019 13:15
Python installation candidate handling

states.yml lists some possible states we can consider for installable candidates and how we can create new artifacts that give us more information during the installation process.

Conventions:

  1. If no action applies, than it's a failure
  2. If no conditional state within an action applies, then it's a failure

One possible implementation may look like:

Output of inspect.is* for all members of

class Example:
 @property
 def _property(self):
  pass
 async def _coroutine(self):
  pass
 async def _coroutinegen(self):
@chrahunt
chrahunt / exampleBot.user.js
Created January 29, 2015 20:18
A userscript-based starter bot for the game TagPro.
// ==UserScript==
// @name TagPro Example Bot
// @description Limited example bot for TagPro.
// @version 0.1
// @grant none
// @include http://tagpro-maptest.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @author Cflakes, snaps_
// @namespace http://www.reddit.com/user/snaps_
@chrahunt
chrahunt / ClientLibrary.py
Created September 8, 2018 13:56
Websocket test library example.
import asyncio
import functools
import inspect
import os
import re
import subprocess
import sys
import threading
@chrahunt
chrahunt / README.md
Last active May 27, 2018 22:46
Downloading replays from tagproreplays the manual way.

TagProReplays Replay Recovery

To set up the helper script, we need to run it on the background page for the extension. Here's one way to do that:

  1. Navigate to chrome://extensions/

  2. Click on the developer mode checkbox on the top right of the extensions page.

    Step 2

  3. Click on the background page link that should appear underneath the TagProReplays extension entry on the extensions page.

@chrahunt
chrahunt / Code.gs
Created May 30, 2016 05:56
Maps API in Google Sheets
var Properties = PropertiesService.getScriptProperties();
/**
* Return rate-limited function under specified delay.
* @param {Function} fn The function to wrap.
* @param {string} domain The domain under which to apply the delay.
* @param {number} delay Time (in ms) between successive calls.
* @return {Function} The function to call.
*/
function RateLimited(fn, domain, delay) {
@chrahunt
chrahunt / example-offense-bot.user.js
Created February 21, 2015 02:36
Example Offense Bot that makes use of tagpro-navmesh library.
// ==UserScript==
// @name TagPro Example Offense Bot
// @description Limited example offense bot for TagPro.
// @version 0.1
// @grant none
// @include http://tagpro-maptest.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @author snaps_
// @namespace http://www.reddit.com/user/snaps_
// ==UserScript==
// @name TagPro Tile Pattern
// @namespace http://www.reddit.com/u/snaps_/
// @description Tints every other floor tile a slightly different shade.
// @include http://tagpro-*.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://*.newcompte.fr:*
// @license GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// @author snaps
// @version 0.1.0