Skip to content

Instantly share code, notes, and snippets.

View gary's full-sized avatar
🌐
Working from home

Gary Iams gary

🌐
Working from home
View GitHub Profile
@gary
gary / keybase.md
Created November 14, 2017 22:47
Keybase Proof

Keybase proof

I hereby claim:

  • I am gary on github.
  • I am giams (https://keybase.io/giams) on keybase.
  • I have a public key ASCHZYrVj4BBeaCo8zT14xUw7z2xiq7SZYbhusDYCI1_Lwo

To claim this, I am signing this object:

From 4474caab21f80a2c5e0ba6af3dd1465a19ce1378 Mon Sep 17 00:00:00 2001
From: Gary Iams <giams@di.fm>
Date: Thu, 16 Jun 2016 19:27:25 -0400
Subject: [PATCH] Quick 'n dirty solution for reducing logging noise
- Disable NewRelic. Reporting issues instrumenting the AssetsController.
- Fix how VipsProcessor constant is referenced in the AssetsController
- Ignore the response code from Image#destroy_file!'s WebDAV request
---
api/app/controllers/assets_controller.rb | 8 ++++----
@gary
gary / anonymous-gist.rb
Last active April 22, 2016 20:07
#map invocation wtf
open(url) { |channel| JSON.parse(channel.read) }.map do |channel_data|
attrs = channel_data.values_at("id", "key", "name", "description",
"asset_url", "created_at", "updated_at")
Channel.new(*attrs).tap(&:pick_stream_url)
end
# => #<Enumerator: [{"json"=>"attrs"}, { "json"=> "attrs"},{"json"=>"attrs"}]:map>
open(url) { |channel| JSON.parse(channel.read) }.map { |channel_data|
attrs = channel_data.values_at("id", "key", "name", "description",
"asset_url", "created_at", "updated_at")
@gary
gary / anonymous-gist.
Created March 3, 2016 18:20
yagist test
From emacs
@gary
gary / headless.rb
Created October 28, 2014 15:33
Headless support
if ENV['HEADLESS']
require 'headless'
headless = Headless.new
headless.start
at_exit { headless.destroy }
end
@gary
gary / nginx_request_time_format.rb
Last active August 29, 2015 14:02
NGINX request time custom format
#!/usr/bin/env ruby -w
require 'request_log_analyzer'
# for use with wvanbergen/request-log-analyzer
class NginxRequestTimeFormat < RequestLogAnalyzer::FileFormat::Nginx
line_definition :current_request_time do |line|
line.captures << { :name => :request_time, :type => :msec }
line.regexp = %r|- (\d+.\d+)$|
@gary
gary / org.gnu.emacsd.plist
Created May 8, 2014 22:05
launchd script as a starting point for a demonization effort. Edit and place in ~/Library/LaunchAgents
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<false/>
<key>Label</key>
<string>org.gnu.emacsd</string>
<key>ProgramArguments</key>
<array>
@gary
gary / .netrc
Last active August 29, 2015 13:55
Login to the GitHub API with 2fa and netrc
machine api.github.com
login # your GitHub username
password # your GitHub password
@gary
gary / software-testing-types-misconceptions.md
Last active December 31, 2015 21:59
On Types of Software Testing and Misconceptions

+-------------------+ +-------------------+ | Black Box Testing | | White Box Testing | +-------------------+ +-------------------+

@gary
gary / gary.pp
Last active December 22, 2015 22:29
Boxen personal module first cut--aka, where's my -t
class people::gary {
include osx::global::key_repeat_rate
class { 'osx::global::key_repeat_delay':
delay => 10
}
# no sudo prompt or error notification
# FIXME:
exec { 'hotfix for shitty osx 10.8 defaults':
command => "/Users/${::boxen_user}/bin/apply-osx-defaults.sh",