Skip to content

Instantly share code, notes, and snippets.

@briangordon
briangordon / eve-pathfinder.cpp
Last active January 3, 2017 19:43
My improved version of MagicalTux's EVE online path finder.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <unordered_map>
#include <sys/time.h>
// We specify the total number of systems explicitly so that we can initialize data structures before reading in the whole csv file.
@briangordon
briangordon / wolfenstein-the-old-blood-headers.txt
Last active March 27, 2016 01:45
I attached a debugger to a running Wolfenstein: The Old Blood process and found this in memory. I have no idea why it's there.
This file has been truncated, but you can view the full file.
CHEATENGINE `êcžö áÏ Ð|¤ö generic unknown error KÊžö Px¤ö ¤ö P~¤ö  |¤ö °|¤ö Ð|¤ö iostream iostream stream error  KÊžö Px¤ö 0¤ö  ~¤ö `|¤ö °|¤ö Ð|¤ö system invalid string position string too long specularPowers bool aiEditable.actionSettings.taunt.tauntMinInterval float * aiConstants.physics.clipMask.shotClip probability int maxLookAngles idVec2 weaponVars.burstWaitTime int swapParticle float bool float onSprinting * idAngles int staticSpecularVector idDeclParticle bool aiEditable.movement.usesSmoothAnimSearch int aiEditable.targeting.spottedMax idVec3 specularScales bool aiEditable.actionSettings.taunt.tauntMaxInterval float int aiConstants.physics.clipMask.ikClip int minIdleTime int howLongToHold idVec2 weaponVars.randomness destroyParticle float bool onShooting int additiveBlendLight * idDeclParticle bool aiEditable.movement.usesSmoothAnimCombat * aiEditable.ta
@briangordon
briangordon / list-processes.ps1
Last active June 3, 2017 23:48
Short PowerShell snippet I wrote for repeatedly dumping all running processes less than a minute old to a file
while($true) {
Get-Process | ? {$_.StartTime -gt (Get-Date).AddMinutes(-1)} | Select-Object ProcessName,Description,Path >> out.txt
sleep 0.01
}
@briangordon
briangordon / animal-verbs.txt
Last active October 7, 2019 18:49
Animal names which are also verbs
Ape his behaviors
Badger her about
Bat your eyelids
Bear fruit
Buck the system
Buffalo him into
Bug him about
Carp about
Chicken out
Clam up
@briangordon
briangordon / gist:df79f7cd3750ac9fe1109553c8262aee
Last active September 11, 2017 00:59
pureconfig ConfigReader for case class with "auxiliary constructor" type logic
case class HalfLife(lowerBoundHours: BigDecimal, upperBoundHours: BigDecimal, meanHours: BigDecimal)
def computeMean(lowerBoundHours: BigDecimal, upperBoundHours: BigDecimal): BigDecimal = {
// TODO linear interpolation is terrible here. These are exponential quantities.
(lowerBoundHours + upperBoundHours) / 2
}
// Hack to get pureconfig to create instances of HalfLife without an explicit mean-hours value.
import com.typesafe.config.{ConfigObject, ConfigValueFactory}
import pureconfig.ConfigReader
package cellfactory
import javafx.application.Application
import javafx.collections.FXCollections
import javafx.scene.control.ListView
import javafx.scene.layout.StackPane
import javafx.scene.{Scene, control => jfxsc}
import javafx.stage.Stage
import javafx.util.Callback
@briangordon
briangordon / git-review-aliases.txt
Last active September 16, 2022 17:51
Aliases for code reviewing GitHub pull requests using a GitFlow/OneFlow branching model
*****************************************************************************************************************************
Introduction
The code review workflow that I prefer is to check out a feature branch, then `reset --soft` to move the branch HEAD to
just before the changes. That way I still have all of the changes in my working copy, and those exact changes are staged
for commit. My IDE will highlight the changed lines right in the editor and let me click the gutter to view a quick diff.
This is incredibly useful. But problems arise when develop has been merged into a running PR, bringing along a whole bunch
of other unrelated changes that have already been reviewed. I don't want all of those other changes to be highlighted in
my IDE, but I do want them in my working copy.

Keybase proof

I hereby claim:

  • I am briangordon on github.
  • I am brian (https://keybase.io/brian) on keybase.
  • I have a public key ASA8l7cfD9ar5ZcXq_MkGZCVjV9B9eo9l1dpQ5D4LsgOsAo

To claim this, I am signing this object:

@briangordon
briangordon / gist:d6014bc1b96f6d89a51ce7906cea9a03
Created November 16, 2018 00:29
Dtrace one-liner for watching readers of your chrome profile
dtrace -n 'syscall::open*:entry /strstr(copyinstr(arg0), "Chrome/Default") != NULL/ { printf("%s %s",execname,copyinstr(arg0)); }' > chrome-accessors
@briangordon
briangordon / DefaultKeyBinding.dict
Created January 25, 2019 06:54
Put this in ~/Library/KeyBindings/ to fix MacOS home/end keys behaving stupidly
{
"\UF729" = moveToBeginningOfParagraph:; // home
"\UF72B" = moveToEndOfParagraph:; // end
"$\UF729" = moveToBeginningOfParagraphAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfParagraphAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}