Skip to content

Instantly share code, notes, and snippets.

View tygerbytes's full-sized avatar
🦖

Ty Walls tygerbytes

🦖
View GitHub Profile
@tygerbytes
tygerbytes / resolv.rb.diff
Last active December 29, 2016 02:20
Ruby 2.3 on Windows: Fix "incompatible character encoding: UTF-8 and ASCII-8BIT" error
diff --git a/lib/ruby/2.3.0/resolv.rb b/lib/ruby/2.3.0/resolv.rb
index 9a981b9..c519e0e 100644
--- a/lib/ruby/2.3.0/resolv.rb
+++ b/lib/ruby/2.3.0/resolv.rb
@@ -773,7 +773,7 @@ class Resolv
service = [host, port]
id = DNS.allocate_request_id(host, port)
request = msg.encode
- request[0,2] = [id].pack('n')
+ request[0,2] = [id].pack('U')

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@tygerbytes
tygerbytes / Out-Email.ps1
Last active September 13, 2018 20:54
Out-Email: PowerShell function/cmdlet that tees output stream to an email
# Out-Email (github.com/tygerbytes)
#
# Example:
# Process-LotsOfWork | Out-Email -To bob@example.com, tina@example.com -Subject "Lots of work"
# Sends an email to Bob and Tina with the output of the function, Process-LotsOfWork.
#
# Example (Redirect all streams to standard output so that errors will appear in email):
# Process-LotsOfWork *>&1 | Out-Email [...]
#
# Example (Continue processing output after piping to Out-Email):
# http://EditorConfig.org
root = true
[*]
indent_size = 2
indent_style = space
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
@tygerbytes
tygerbytes / Register-DynamicArgumentCompleters.ps1
Last active June 19, 2021 07:13
Register tab completion for custom commands that change depending on the current directory.
param(
[Parameter(Mandatory=$true)]
[String[]]$commandsToComplete)
<#
.SYNOPSIS
Register tab completion for custom commands that change depending on the current directory.
Source: https://gist.github.com/tygerbytes/833a73fe77f1f426f1f094c6ae7b5b2c
Author: Ty Walls (https://twitter.com/tygertec)
Website: https://www.tygertec.com
<div class="text-muted"><%= run_type.description %></div>
<div class="text-muted">{{ this.runType.description }}</div>
<div class="form-group">
<%= label_tag(:run_type, 'Today, I plan on running:') %>
<div class="input-group">
<%= select_tag(
:run_type,
options_for_select(TargetPaceHelper::all_run_types, :DistanceRun),
{:class => 'form-control'})
%>
</div>
<div class="text-muted" id="run_type_explanation">
<div class="form-group">
<label for="run_type">Today, I plan on running:</label>
<div class="input-group">
<select name="run_type"
@change="changeRunType()"
class="form-control"
v-model="runTypeOption">
<option v-for="run in lib.runTypes"
v-bind:value="run.code"
v-bind:key="run.Code">
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
data-target="#navbar-collapse-1" aria-expanded="false">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>