Skip to content

Instantly share code, notes, and snippets.

Tim Haines timhaines

View GitHub Profile
@timhaines
timhaines / lambda.js
Created Jan 11, 2019 — forked from luketheobscure/lambda.js
Percy Bitbucket AWS Lambda
View lambda.js
const https = require('https');
const AUTHORIZATION = ''; // base 64 of user:password
const BITBUCKET_USER = ''; // either the user or the org that owns the repo
const PERCY_USER = ''; // the name of your percy user or org
exports.handler = (event, context, callback) => {
/**
We need to post to a URL like this:
https://api.bitbucket.org/2.0/repositories/<user>/<repo>/commit/<hash>/statuses/build
@timhaines
timhaines / mirage.config.js
Last active Apr 16, 2017
Mirage Dev Boilerplate
View mirage.config.js
export default function() {
//window.server = this;
this.get('users');
};
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View test_busy_workers_with_rack_test.rb
it 'can display busy workers' do
get '/busy'
assert_equal(200, last_response.status)
assert_match(/status-active/, last_response.body)
assert_match(/critical/, last_response.body)
assert_match(/WebWorker/, last_response.body)
assert_match(/Quiet/, last_response.body)
assert_match(/Stop/, last_response.body)
end
View test_busy_workers_with_capybara_and_percy.rb
it 'can display busy workers' do
visit '/busy'
assert_equal(200, page.status_code)
assert_selector('.status-active')
assert_text('critical')
assert_text('WebWorker')
assert has_button?('Quiet All')
assert has_button?('Stop All')
@timhaines
timhaines / additions_to_test_helper.rb
Last active Jan 18, 2017
Converting Sidekiq Minitest Rack::Test tests to Capybara, and introducing Percy snapshots
View additions_to_test_helper.rb
# Initialize and finalize Percy.io
Percy::Capybara.initialize_build
MiniTest.after_run {
Percy::Capybara.finalize_build
}
View gist:603ac777d9f694775bf2ab56669a8036
52.10.151.64
52.10.207.79
52.10.59.137
52.26.168.24
52.33.182.54
52.35.101.107
52.37.117.181
52.37.169.220
52.37.249.86
52.39.245.19
@timhaines
timhaines / Sharing podcast subscriptions with Tim.md
Last active May 27, 2016
Sharing podcast subscriptions with Tim
View Sharing podcast subscriptions with Tim.md

Hi and thank you!

I'm playing around with some new ideas, and would love to have your podcast subscriptions.

Apple's Podcast app - via iTunes

First export an OPML file from iTunes, and then email me. :)

  1. Open itunes, and go to the podcasts section. You may need to sync or refresh (bottom left)
  2. Click on File -> Library -> Export Playlists
  3. Choose the OPML file format
View Elastic Search Notes
## Useful Links
* Home Page - http://www.elasticsearch.org/
* Git HomePage - more info, less marketing: https://github.com/elasticsearch/elasticsearch
* Glossary - http://www.elasticsearch.org/guide/reference/glossary/
* Hands on Intro - Hammer Time - https://github.com/s1monw/hammertime
* Node client - https://github.com/phillro/node-elasticsearch-client
* Mongo River - to stream data in from Mongo - https://github.com/richardwilly98/elasticsearch-river-mongodb/
* How to setup with Chef Solo - http://www.elasticsearch.org/tutorials/deploying-elasticsearch-with-chef-solo/
* Elastic Search on EC2 - http://www.elasticsearch.org/tutorials/elasticsearch-on-ec2/
@timhaines
timhaines / gist:6153982
Last active Dec 20, 2015
Consent of the governed - from the 2nd paragraph of the Declaration of Independence
View gist:6153982
We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness.--That to secure these rights, Governments are instituted among Men, deriving their just powers from the consent of the governed, --That whenever any Form of Government becomes destructive of these ends, it is the Right of the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness.
You can’t perform that action at this time.