Skip to content

Instantly share code, notes, and snippets.

View mhenrixon's full-sized avatar
🐢
I may be slow to respond.

Mikael Henriksson mhenrixon

🐢
I may be slow to respond.
View GitHub Profile
db.assets.ensureIndex({"tags.callname": 1, "tags.tags": 1}, {background: true})
// index [['tags.callname', 1, ['tags.tags', 1]], { background: true }
db.permalinks.ensureIndex({"linkable_uuid": 1, "_current": 1}, {background: true})
db.matches.ensureIndex({"id": 1, "_id": 1}, {background: true})
db.live_events.ensureIndex({"asset_id": 1, "asset_version": 1, "_id": 1}, {background: true})
db.mediafiles.ensureIndex({"match_id": 1, "filename": 1}, {background: true})
db.users.ensureIndex({"confirmation_token": 1}, {background: true})
db.assets.ensureIndex({"match_id": 1, "created_at": 1}, {background: true})
db.orders.ensureIndex({"customer_id": 1, "order_status": 1}, {background: true})
db.matches.ensureIndex({"sport_id": 1, "name": 1, "starts_at" -1 }, {background: true})
@mhenrixon
mhenrixon / facebook_registration.rb
Created July 15, 2018 14:03 — forked from nicalpi/facebook_registration.rb
Testing Omniauth with Devise, Rspec and Capybara
background do
set_omniauth()
click_link_or_button 'Sign up with Facebook'
end
@mhenrixon
mhenrixon / keybase.md
Created March 29, 2017 08:33
keybase.md

Keybase proof

I hereby claim:

  • I am mhenrixon on github.
  • I am mhenrixon (https://keybase.io/mhenrixon) on keybase.
  • I have a public key whose fingerprint is 8CC8 80A4 ED67 9027 D1FB 0EE7 48CE 83E6 A7B6 5689

To claim this, I am signing this object:

@mhenrixon
mhenrixon / docker-compose.yml
Created March 23, 2017 10:33 — forked from mdub/docker-compose.yml
How to share a /usr/local/bundle cache between Ruby build jobs
version: "2"
services:
dev:
image: ruby:2.3
volumes:
- .:/project
- ruby2.3-bundle-cache:/usr/local/bundle
working_dir: /project
# Author: Pieter Noordhuis
# Description: Simple demo to showcase Redis PubSub with EventMachine
#
# Update 7 Oct 2010:
# - This example does *not* appear to work with Chrome >=6.0. Apparently,
# the WebSocket protocol implementation in the cramp gem does not work
# well with Chrome's (newer) WebSocket implementation.
#
# Requirements:
# - rubygems: eventmachine, thin, cramp, sinatra, yajl-ruby
@mhenrixon
mhenrixon / .travis.yml
Created September 9, 2016 07:46
How to push coverage to code climate from travis-ci when running rspec from docker-compose
sudo: required
language: ruby
services:
- docker
script:
- docker-compose run -e TRAVIS=$TRAVIS -e TRAVIS_BRANCH=$TRAVIS_BRANCH -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID -e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST rspec
- docker-compose run -e TRAVIS=$TRAVIS -e TRAVIS_BRANCH=$TRAVIS_BRANCH -e TRAVIS_JOB_ID=$TRAVIS_JOB_ID -e TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST test_app
@mhenrixon
mhenrixon / after.txt
Created August 20, 2015 11:57
A comparison of before and after optimizing for memory usage and performance.
Total allocated: 526174 bytes (9496 objects)
Total retained: 680 bytes (17 objects)
allocated memory by gem
-----------------------------------
526174 wodconnect/app
allocated memory by file
-----------------------------------
152252 /Users/mhenrixon/code/kiskolabs/wodconnect/app/models/bill.rb
@mhenrixon
mhenrixon / DiagnostigsReport.log
Last active August 29, 2015 14:27
let_it_go crash reports
Process: ruby [19993]
Path: /Users/USER/*/ruby
Identifier: ruby
Version: 0
Code Type: X86-64 (Native)
Parent Process: zsh [14987]
Responsible: iTerm2 [11084]
User ID: 501
Date/Time: 2015-08-18 13:55:44.681 +0200
@mhenrixon
mhenrixon / circle.yml
Last active August 29, 2015 14:23 — forked from jwaldrip/circle.yml
machine:
services:
- 'postgresql'
- 'redis'
environment:
REDIS_URL: 'redis://localhost:6379/0'
dependencies:
pre:
- 'git config user.email [email protected]'
- 'git config user.name $CIRCLE_USERNAME'

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname