Skip to content

Instantly share code, notes, and snippets.

View bhardin's full-sized avatar
🍖
In meatspace

Brett Hardin bhardin

🍖
In meatspace
View GitHub Profile
@bhardin
bhardin / GIF-Screencast-OSX.md
Created August 18, 2016 16:51 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

### Keybase proof
I hereby claim:
* I am bhardin on github.
* I am bretthardin (https://keybase.io/bretthardin) on keybase.
* I have a public key whose fingerprint is 3BCB B264 8E38 785F 63A5 CF30 B4EF 287D F5E9 AE04
To claim this, I am signing this object:
@bhardin
bhardin / gist:962761029555b68f95fa
Created February 18, 2016 17:11
Cool.io Installation Error
Installing cool.io 1.2.4 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/bhardin/.rbenv/versions/2.0.0-p643/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_alone()... yes
checking for rb_str_set_len()... yes
checking for clock_gettime() in -lrt... no

Unix Epoch to ISO 8601

Time.at(1419839999).to_datetime.iso8601
@bhardin
bhardin / blah.rb
Last active August 29, 2015 14:02
def group(cookies)
return @group if @group
current_set = set_size
i = 0
until @group
if seed <= current_set
@group = groups[i]
else
@bhardin
bhardin / huge_if_statement.md
Last active August 29, 2015 14:00
Which way is better?

Option 1

if target.last_sent_at && target.last_sent_at >= Time.now - 23.hours && !ignore_rules
  next
end

Option 2

@bhardin
bhardin / Question
Created April 2, 2014 23:59
Optimization Report Confusion
Talked to Percy and the query https://gist.github.com/njm/3f0197b817e9c418c1e9, returns something like this?
```
[["variation-name"], [[1,2,3,4,5,6,7,8,9,10,11,12], [12,11,10,9,8,7,6,5,4,3,2,1]]]
```
__What do I return?__
_Option 1:_
{ "name" => variation_name, "totals" => 1, "conversions" => 12 }
@bhardin
bhardin / gist:7470435
Created November 14, 2013 17:06
Writing RSpec Tests
Tests should test valid input first and then edge cases.
```ruby
describe 'when this happens' do
it "does good" do
end
end
describe 'when this other thing happens' do
it 'does something else' do
@bhardin
bhardin / gist:7416214
Last active December 28, 2015 00:49
Question for Avdi

When checking for valid input, we could raise an exception to make it more helpful to the developer doing the implementation.

Current code:

def initialize(params)
  super
 
  raise ArgumentError, "Must provide results base dir." unless params.has_key?("dir")
 @dir = params["dir"]
@bhardin
bhardin / gist:7339955
Last active December 27, 2015 14:19
How @ messages in Hipchat should be used

The @ Symbol in Hipchat

At KISSmetrics, our team is distributed around the United States World. When we interview candidates a common question is, how do we like working remotely.

We love it. We use Hipchat as our water cooler, break room, and discussion area.

In Hipchat, anytime someone mentions you with an @ in front of your name the dock bounces and a sound goes off. This means that someone is attempting to bring something to your attention. There is also an @all that will ping everyone that is in the room, even if they are offline and an @here that will ping only those in the room that are active.

When using the @ symbol please remember that a person should be mentioned only when you need there attention. Not when you are talking about them and don't need there input. The symbol SHOULD ONLY be used when the person needs to be brought into the conversation. It SHOULD NOT be used when mentioning the person in general.