Skip to content

Instantly share code, notes, and snippets.


ara.t.howard ahoward

Block or report user

Report or block ahoward

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ahoward / caching-https-creds.markdown
Created Jun 6, 2012
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

ahoward / net-http-debug.rb
Created Dec 10, 2010
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)
ahoward / wtf-google-geocode.json
Created Feb 3, 2011
wtf - alaska... or texas!?
View wtf-google-geocode.json
"status": "OK",
"results": [ {
"types": [ "park", "establishment" ],
"formatted_address": "Kincaid Park, 6998 Raspberry Rd, Anchorage, Texas 99502, USA",
"address_components": [ {
"long_name": "Kincaid Park",
"short_name": "Kincaid Park",
"types": [ "establishment" ]
}, {
View proc-gt-module.rb
#! /usr/bin/env ruby
# ClassMethods/InstanceMethods as modules are nice. but procs are mo betta. you can't do any of the following via modules.
module M
ClassMethods = proc do
class << self
alias_method 'bar', 'foo'
ahoward /
Created Aug 27, 2012
a simple favicon generator using image magick
#! /bin/sh
# file : ~/bin/favicon
# usage: favicon foo.png
convert "$@" -resize 16x16 favicon-16.png
convert "$@" -resize 32x32 favicon-32.png
convert "$@" -resize 64x64 favicon-64.png
convert "$@" -resize 128x128 favicon-128.png
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 / a.rb
Created Jan 31, 2019
rails just *cannot* run in threads. doing even simple things will bork it in strange and magical ways
View a.rb
class A
attr_accessor :dsl
attr_accessor :state
def initialize
@state = []
@dsl = self.class.dsl
View best-mixin-stratgey.rb
#! /usr/bin/env ruby
# this is best practice for writing mixins. the deferred evaluation is more
# powerful that the approach of ClassMethods/InstanceMethods as modules too
module Mixin
# put your class level code in here
ClassMethods = proc do
ahoward / example.rb
Created Aug 16, 2018
even though i author'd main.rb - which is a really complete cli tool, i 've been yearning for something simpler for writing small cli tools. eg. in a rails ./scripts/ directory...
View example.rb
#! /usr/bin/env ruby
require_relative '../lib/script.rb'
script {
help '
run {
View a.js
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import firebase from 'firebase'
Vue.config.productionTip = false
You can’t perform that action at this time.