Skip to content

Instantly share code, notes, and snippets.

@ejholmes
ejholmes / gist:f419c53aa6b671b8d123
Last active August 29, 2015 14:04
API Resource
package main
import (
"encoding/json"
"os"
"time"
)
// Timestamp wraps time.Time and implements the json.Marshaller interface
// for presenting a timestamp in ISO8601 format.
https://medium.com/@mkadenbach/boot2docker-together-with-virtualbox-guest-additions-da1e3ab2465c
find . -type f | xargs perl -pi -e 's/applicationX/applicationY/g'
-- Cause all query output to be piped to the OS X clipboard
\o | /usr/bin/pbcopy
@ejholmes
ejholmes / gist:2b796278ca42cba23cd4
Created May 23, 2014 02:38
Convert CR2 files to JPG.
brew install imagemagick
brew install ufraw
for infile in *.CR2; do convert $infile $(echo $infile|sed -n "s/CR2$/jpg/p"); done
@ejholmes
ejholmes / gist:9095577
Created February 19, 2014 16:25
Investment Day

Investment Day

  • Fix slow queries.
  • Refactor code that's been bothering you.
  • Extract an open source library.
@ejholmes
ejholmes / Gemfile
Created February 7, 2014 05:41
Shipr test repo
source 'https://rubygems.org'
gem 'rake'
@ejholmes
ejholmes / gist:8593375
Last active January 4, 2016 08:09
ngTooltip

ngTooltip

A modern angularjs directive/service for building tooltips and popovers.

Usage

As a directive

Best for simple tooltips.

require 'active_record'
require 'logger'
# Print out what version we're running
puts "Active Record #{ActiveRecord::VERSION::STRING}"
ActiveRecord::Base.logger = Logger.new(STDOUT)
# Connect to an in-memory sqlite3 database
ActiveRecord::Base.establish_connection( :adapter => 'sqlite3',
@ejholmes
ejholmes / gist:8156063
Created December 28, 2013 04:17
ngSubmitLoading
(function(angular) {
'use strict';
var module = angular.module('ngSubmitLoading', []);
/**
* A directive that adds a `$loading` attribute to the ngForm controller
* until the promise is fullfilled.
*
* @example