Skip to content

Instantly share code, notes, and snippets.

<sendEmail
xmlns="http://schemas.blinkbox.com/books/emails/sending/v1"
xmlns:r="http://schemas.blinkbox.com/books/routing/v1"
r:originator="bookStore"
r:instance="book-store.mobcast.co.uk"
r:messageId="9678170f7c21-47dc-d8f3-a60f-c73e4c58">
<template>password_reset</template>
<to>
{
"version": 1,
"variables": [{
"names": ["email", "phone"],
"values": [
["a@sink.sendgrid.net", "07911111189"],
["b@sink.sendgrid.net", "07911111166"],
["c@sink.sendgrid.net", "07922222222"],
["d@sink.sendgrid.net", "07933333333"]
]}
class C
@v = "Bah bah"
def m
p @v
p @@v # The Class instance variable is not the same as a class variable
end
def self.m
p @v
@githubmo
githubmo / rail_install.sh
Created January 31, 2013 18:01
Installing Ruby and Ruby on Rails on OSX Mountain Lion
- Install Xcode from the App Store
- Open Xcode, go to preferences > Additional downloads, install Command line tools
- Install Homebrew, the command for installing it can be found at http://mxcl.github.com/homebrew/ under the "Install Homebrew" section
@githubmo
githubmo / gist:4685291
Created January 31, 2013 18:50
Create database and do migrations.
bundle exec rake db:create:all
bundle exec rake db:migrate

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@githubmo
githubmo / Gemfile
Last active December 17, 2015 05:49
Example starting gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.12'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
# Use PostGres for both development and production, keeping the same database with both
gem 'pg'

Keybase proof

I hereby claim:

  • I am githubmo on github.
  • I am githubmo (https://keybase.io/githubmo) on keybase.
  • I have a public key whose fingerprint is 1132 6644 E153 8439 6D6B D019 F210 6591 A590 EF00

To claim this, I am signing this object:

@githubmo
githubmo / README.md
Created September 6, 2017 09:55 — forked from rantav/README.md
Find slow queries in mongo DB

A few show tricks to find slow queries in mongodb

Enable profiling

First, you have to enable profiling

> db.setProfilingLevel(1)

Now let it run for a while. It collects the slow queries ( > 100ms) into a capped collections, so queries go in and if it's full, old queries go out, so don't be surprised that it's a moving target...

@githubmo
githubmo / p4merge-git-tool.md
Last active June 13, 2019 13:06 — forked from dgoguerra/p4merge-git-tool.md
Setup p4merge as difftool and mergetool on Windows

For the final day of the course, we will be looking at how to resolve merge conflicts. One way to do it is via the command line. Another is to use a visuallising diff tool. We will be using P4Merge as our tool and this should be set up for the final day of the course.

There are two ways to set it up: using the command line, and directly editing the config file. Choose the method that you are more comfortable with. I usally tend to use the former.

Setting up from the command line

Being the installation path "C:Program Files\Perforce\p4merge.exe", just run:

$ git config --global diff.tool p4merge
$ git config --global difftool.p4merge.path 'C:\Program Files\Perforce\p4merge.exe'