Skip to content

Instantly share code, notes, and snippets.

View Narnach's full-sized avatar

Wes Oldenbeuving Narnach

View GitHub Profile
# If you have one or two monkey patches, you can easily stick them in an initializer, like this:
# ./config/initializers/monkey_patch_*.rb
# Or if you have some sort of load order requirement, prepend numbers to put them before other initializers:
# ./config/initializers/000_monkey_patch_*.rb
# If you have a lot, you might want to put them in ./app/monkey_patches or some other clearly marked location.
# Require the dependency to ensure it's loaded/available
require 'path/to/class/we/patch' # TODO
# TODO: Describe the problem this monkey patch solves. If possible refer to issue threads, PRs and commits with more details.
@Narnach
Narnach / bump.rb
Created January 29, 2009 15:20
Bump a gem's version, tag it and commit it to git
#!/usr/bin/env ruby
# bump.rb - Perform a project version bump
# * If a .gemspec file is present, use it to determine the current project version
# * Scans for the first line that contains .version and a 1.2.3-ish part
# * If no gemspec is present, use the highest tagged version
# * The expected tag format is '1.2.3'
# * Depending on the command line options 'major', 'minor', 'build' it will
# bump the 1st, 2nd, 4th digit of the version. No option implies a 'release',
# which bumps the 3rd digit. Example: 1.2.3 -> 1.2.4 is a release.
# * Overwrites the current gemspec with the new one if a gemspec was found
#!/usr/bin/env ruby
# Usage: githubify <gemspec_file> [username]
# Requires: github.name to be set for the current git project or [username] to be specified
# Result: creates/overwrites a file named <username>-<gemspec_file> and updates the s.name in there have the same project name format.
#
# Author: Wes Oldenbeuving
# E-mail: narnach@gmail.com
# License: MIT-LICENSE
class String

As of May 2018, this is the gear in my recording setup. I built this system in late 2014 and it was relatively state of the art back then. Over the years a few things have been added (VR headset, extra screen) but the core is relatively good even for today's games. That said, I will probably replace this somewhere during 2018 with the next generation of hardware. Stay tuned :-D

  • CPU: Intel i7 4790K @ 4.0 Ghz
  • CPU cooler: Corsair Hydro H80i (closed loop water cooler)
  • GPU: 2x ATI Strix GTX 980 graphics cards
  • Mainboard: Asus Maximus VII Hero Z97
  • Memory: 16GB Kingston HyperX Beast DDR3
  • Storage: 2x Kingston HyperX 3K SSD 2.5" 240GB + 1x Western Digital Blue WD10EZEX 1TB
  • PSU: Toughpower Grand 1050W ATX2
  • Case: Aerocool XPredator X3 Evil Black edition ATX
@Narnach
Narnach / moved.md
Last active December 7, 2017 19:19
Path of Exile Loot Filter

Loot filters have moved!

This started as a single file, but it grew to three filters. Gists are meant to share single files, so it became kind of awkward to use this. Please check out the filters' new home at https://github.com/Narnach/path_of_exile_loot_filters they are the same files, but it is now easier to pick the one that you want.

@Narnach
Narnach / future.rb
Last active August 16, 2017 10:26
First naive implementation of futures in Ruby
# Simple Future implementation, also known as a Promise in Javascript land.
# Based off an old gist ( https://gist.github.com/Narnach/33661 ) and modernized for Ruby 2.
#
# Wrap a block transparently in a Thread, and redirect any method calls to the `value` of that Thread, aka the return value of a Thread.
# This allows you to create code that runs async but becomes blocking when you try to interact with the result of it.
#
# future = Future.wrap { 1 + 2 }
# future + 3 # => 6
#
# Inherit from BasicObject to not get all the usual cruft and allow _all_ method calls to be proxy'd to the value.
eNrtXWtT40qS_Tz8CgURs9E3GHerqvTs7Z4NDBjcbYPB5vmFKEklLD8ko4fBbNz_vlmSH7It2TKY2313mBtDG5wqlbIyT57Meujb_zz3e8KQ-YHjud930WdxV2Cu6VmO-_B997JVKWm7__PvnW8NGrbP7HLk9Pg3_975x7cD2jMD-PCPb1V3EIWCS_vs-27QdXq9-wH1w13BjfoG86HR3S85ctQMnSE7jeVWy_edwLw3ItuuexbbFYLQjzt4VKkcHbSqV0e5t3AXG1fGok0GN_dcwfR6PToImPV916a9ABp34GOTX9xkPRAqJH_ihIe0Tx9YIelDr1irzQFjViHJA98p3NGDNnVNVlwNrdGANUMaBoUuKfeK9rnhOYHnFhKtPrhOWFC3zKSjQpJ1sKkj2waZYk-2H4LVGVHIionXHLtYj-vUpYUEj1zmP4yabYf1iml43-97kV-s7SHlEFBI9oIFThAW1vEhswFSxlr79mUCHN9iNBF6bMh633cldVcwezQITmPnvaDuA3dbGpjMtQ5mXxwyarERtD502BMHAzCOeuPsorUr9KnjNj2zy8Jj34sGsa8LBnUtJ6wz33R6LAi-7_70qROO3Mk3p57fp3D_M9qd_OnAj3iPTj03Gb9vsRckWBd_FHrU4BJl7-mrUDWZ0Gx7ofBpiP_g4EmNXkoJQc8Lv-9eMzoAHaGkk_sx7MVNcbTjDf_j2zHrT3SBxVQ7IfRmN4Y0QAMTnnZ8v13hMaI9eBRoQkzGongj4_4c9VifuSHtCWPwmrUpb9pks-c9MV9o-F6HWwQo-y2t7VsWs4QDDwzk7V2Lm2kwl4U-5bb6lraqrukzGvDOAeQ6JuiuCbDQnXvc9QMyto5ZuzUwTlBfPeqFzqDHXqvHpXaPobfhezTcaI-C-PFnDQqAkNTsLo_Y5uqo0ID3Omkwo6PfvsTus-yTJ6zXZ-FX4RI6BBfkOWQitgV3PGE-BevybA4EqX6qmxrWCQ19CJwbKG3JA6N-H5yaA8SxB579JoS4

Keybase proof

I hereby claim:

  • I am narnach on github.
  • I am narnach (https://keybase.io/narnach) on keybase.
  • I have a public key ASCzsSjEblHeiJSuCXrH0lTOnjjGis1I2uJsFh7ZduPzPQo

To claim this, I am signing this object:

# The regexp is re-compiled for every line in the file, which is SLOW
# If you are processing a lot of data, inline regexps are to be avoided!
class SlowWorker
def initialize(custom)
@custom = custom
end
def call(file)
File.open(file,'r') do |file|
file.each_line do |line|
@Narnach
Narnach / deploy.rb
Last active December 20, 2015 03:19
deploy.rb replacement for semaphore continuous deployment
# The *real* deploy.rb is located in config/deploy_semaphore.rb
#
# http://semaphoreapp.com performs continuous deployment for us, so we should not perform manual deployments.
# This disables cap deploy, cap deploy:migrations and cap deploy:upload, our most frequently used tasks.
#
# On the semaphore side, use this as the deployment commands to make this work:
#
# mv config/deploy_semaphore.rb config/deploy.rb
# bundle install --path vendor/bundle
# bundle exec cap -S revision=$REVISION deploy:migrations