Skip to content

Instantly share code, notes, and snippets.

View areyoutoo's full-sized avatar

Robert Utter areyoutoo

View GitHub Profile
@areyoutoo
areyoutoo / save_sassy.pl
Created April 21, 2017 18:57
An angry intern abused HipChat and gave Sassy about -16,000 karma. This script gradually resets Sassy's karma back to zero... also a fun excuse to try HipChat's API.
use strict;
use warnings;
use LWP::UserAgent;
use JSON;
use URI;
use POSIX;
use Data::Dumper;
@areyoutoo
areyoutoo / compare_mounts.sh
Last active May 20, 2016 17:09
Work wants to double-check for byte-wise matches after some file servers are copied. This script compares SHA hashes for each file in the resulting trees.
find MOUNT1 -type f -exec shasum {} \; | tee logfile1
find MOUNT2 -type f -exec shasum {} \; | tee logfile2
sort -k2 logfile1 > logfile1s
sort -k2 logfile2 > logfile2s
diff -u logfile[12]s
------------------------------------------------------------
C:\Python34\Scripts\pip run on 10/07/14 23:08:29
Downloading/unpacking pelican
Getting page https://pypi.python.org/simple/pelican/
URLs to search for versions for pelican:
* https://pypi.python.org/simple/pelican/
Analyzing links from page https://pypi.python.org/simple/pelican/
Found link https://pypi.python.org/packages/2.7/p/pelican/pelican-3.4.0-py2.py3-none-any.whl#md5=b6246f58cd02dfba752bb5c9b4534b13 (from https://pypi.python.org/simple/pelican/), version: 3.4.0
Found link https://pypi.python.org/packages/source/p/pelican/pelican-1.1.1.tar.gz#md5=721e60eedcb2bced8bea1e5780c9eaaa (from https://pypi.python.org/simple/pelican/), version: 1.1.1
Found link https://pypi.python.org/packages/source/p/pelican/pelican-1.1.tar.gz#md5=e12e3b2880b2d6eb179b6227d32b0de2 (from https://pypi.python.org/simple/pelican/), version: 1.1

Canned responses for Unity Answers.

Mainly useful for moderation queue. Might grow over time.

using UnityEngine;
using System.Collections.Generic;
public class HighFreqInput : MonoBehaviour {
struct InputEvent {
public readonly bool keyUp;
public readonly KeyCode keyCode;
public readonly int frame;
public readonly float time;
@areyoutoo
areyoutoo / dedup.conf
Last active November 5, 2017 01:56
Dropping duplicate events in Logstash
# Dropping duplicate events in Logstash
#
# Explanation:
# - Add a hashed field with the anonymize filter (it's fast)
# - ES docs are unique per index/docid, duplicates will be overwritten
# - Set ES "document_id" field when submitting
#
# Caveats:
# - Adds a nonsense field to your events. Annoying but harmless.
# - Make sure that whatever field(s) you hash are unique!
public class ImplodingEmitter : MonoBehaviour {
void Start() {
StartCoroutine(Implode());
}
IEnumerator Implode() {
if (!particleSystem.isPlaying) {
particleSystem.Play();
}
@areyoutoo
areyoutoo / UnitySpecialFolders.md
Last active December 25, 2015 18:39
A list of special folder names in the Unity Editor.

Scripting namespaces

UnityEditor namespace:

  • ./Editor
  • ./Plugins/Editor
  • ./Standard Assets/Editor
  • ./Pro Standard Assets/Editor

(can we have an "Editor" folder elsewhere? probably not)

@areyoutoo
areyoutoo / __commands
Last active December 21, 2015 03:29
Reduced test case for an XPath locator problem when using Selenium RC 2.34.0 with Firefox 23.0
Quick explanation of the problem:
This works fine:
open(...)
selectFrame(...)
click(css=#anchor)
This does not: