Skip to content

Instantly share code, notes, and snippets.

probably outside if i'm not hacking.

ara.t.howard ahoward

probably outside if i'm not hacking.
View GitHub Profile
ahoward / caching-https-creds.markdown
Created June 6, 2012 21:42
Fix Username/Password prompting for github repos cloned via https scheme
View caching-https-creds.markdown

github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers

in your home directory create a file called '.netrc', for example


in it put these contents

View gist
#! /usr/bin/env ruby
Main {
name 'gist'
description <<-__
command line script for writing and reading to
examples <<-__
ahoward / rpc.rb
Last active January 2, 2023 19:02
clean rpc based javascript helpers for rails' controllers
View rpc.rb
web apps nearly always end up needing a plethora of little javascript helper methods: you know, auto-complete forms, populating defaults, validations, etc. these aren't API calls properly, just little tidbits of functionality needed to make the views work.
there is always a question of which controller to hang these methods off of. do you make a global helper controller for all this stuff? do you hang them off the controller in question? how to do share the backend of javascript helper methods across controllers?
step one
ahoward /
Created April 6, 2020 18:27
fixes "# mesg: ttyname failed: Inappropriate ioctl for device" warnings during docker build
# fixes "# mesg: ttyname failed: Inappropriate ioctl for device" warnings when building docker
echo '#! /bin/sh' > /usr/bin/mesg
chmod 755 /usr/bin/mesg
# all this does is replace the 'mesg' command with a no-op that always succeeds.
# do this *early* in your Dockerfile somewhere.
# from a security persprective this is also fine because it relates to multi-user unix systems,
# not single user/contrained docker images.
View html5-file-reading.html
doing a large chunked upload of content using html5's file input feature is tricky.
this simple example should help you out.
ahoward / net-http-debug.rb
Created December 10, 2010 20:06
a simple way to debug tons of libs that use ruby's net/http
View net-http-debug.rb
require 'net/http'
Net::HTTP.module_eval do
alias_method '__initialize__', 'initialize'
def initialize(*args,&block)
__initialize__(*args, &block)
s = """Gur Mra bs Clguba, ol Gvz Crgref
Ornhgvshy vf orggre guna htyl.
Rkcyvpvg vf orggre guna vzcyvpvg.
Fvzcyr vf orggre guna pbzcyrk.
Syng vf orggre guna arfgrq.
Fcnefr vf orggre guna qrafr.
Ernqnovyvgl pbhagf.
Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf.
Nygubhtu cenpgvpnyvgl orngf chevgl.
ahoward / polluted.rb
Created November 8, 2012 16:15
ruby libs have *got* to stop doing this...
View polluted.rb
libs = ARGV.size == 0 ? all_gems : ARGV
list =
forkify(16){|lib| puts "#{ lib }..."; [lib, polluted_by(lib)]}.
sort_by{|pair| pair.last}
list.each do |lib, polluted|
puts "polluted_by('#{ lib }') #=> #{ polluted }"
ahoward / a.rb
Created April 18, 2017 14:05
categorize your taxes in a hurry with this ruby script!
View a.rb
#! /usr/bin/env ruby
require 'csv'
require 'pp'
require 'readline'
require 'fileutils'
require 'rubygems'
require 'main'
View jqm-data-cache-never.js
// force certain pages to be refreshed every time. mark such pages with
// 'data-cache="never"'
jQuery('div').live('pagehide', function(event, ui){
var page = jQuery(;
if(page.attr('data-cache') == 'never'){