Skip to content

Instantly share code, notes, and snippets.


Eric Boehs ericboehs

View GitHub Profile
View proxy.pac
function FindProxyForURL(url, host) {
if (shExpMatch(host,"*")) {
return PROXY;
if (shExpMatch(host,"*.vetsgov-internal")) {
return PROXY;
View blink-solarized.js
View s3_directory_service.rb
# frozen_string_literal: true
# This file lives in lib/active_storage/service/s3_directory_service.rb.
require 'aws-sdk-s3'
require 'active_storage/service/s3_service'
require 'active_support/core_ext/numeric/bytes'
module ActiveStorage
class Service
View assinc.rb
require 'minitest/autorun'
class TestArray < Minitest::Test
def test_array
assert_includes %(a b c), 'a'
def test_array_refutation
refute_includes %(a b c), 'd'
View yts_downloader
#! /usr/bin/env ruby
require 'cgi'
require 'net/http'
require 'json'
# Adds a movie to based on search term
class MovieDownloader
attr_reader :term
ericboehs / application_record.rb
Last active Sep 7, 2019
Helper method to get the URL to an ActiveStorage Blob/Variant
View application_record.rb
# frozen_string_literal: true
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
def attached_url_for(attached, variant: nil, cloudfront_endpoint: ENV['CLOUDFRONT_ENDPOINT'], fallback_url: nil)
if attached.attached?
attached = attached.variant variant if variant
path_helper = Rails.application.routes.url_helpers.method :rails_blob_path
ericboehs / index.html
Last active Aug 25, 2019
Sticky side and top nav via UIKit and position: sticky
View index.html
<link rel="stylesheet" href="" />
<script src=""></script>
<script src=""></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
.tm-height-100vh { height: 100vh; }
.tm-position-top-sticky {
ericboehs / autocomplete.html
Last active Jul 16, 2019
Vanilla JavaScript Autocomplete
View autocomplete.html
<!-- Check out the codepen here: -->
<div class="uk-container-xsmall uk-margin-top uk-margin-auto">
<input class="tm-autocomplete-input uk-input" autocomplete="false" type="text" placeholder="Search Country...">
<ul class="tm-autocomplete" hidden></ul>
ericboehs / # weechat - 2019-01-28_12-14-47.txt
Created Jan 28, 2019
weechat on macOS 10.14.2 - Homebrew build logs
View # weechat - 2019-01-28_12-14-47.txt
Homebrew build logs for weechat on macOS 10.14.2
Build date: 2019-01-28 12:14:47
ericboehs /
Last active Jan 25, 2019
weechat with curl doesn't work demo
# Install working version
brew uninstall weechat; brew install --with-python@2 --with-perl --with-ruby --with-lua --with-aspell
# Download perl script via weechat (make sure you type /quit in weechat to continue)
rm ~/.weechat/perl/ ~/.weechat/perl/autoload/ 2> /dev/null; weechat -r "/script install"; ls ~/.weechat/perl/ 2>&1 > /dev/null && echo "It worked" || echo "It failed"
# Install broken version
brew uninstall weechat; brew install weechat
# Download perl script via weechat (make sure you type /quit in weechat to continue)
You can’t perform that action at this time.