Skip to content

Instantly share code, notes, and snippets.


Matt Freer mattfreer

  • Birmingham, UK
View GitHub Profile
View docker-ssh-forward.bash
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK):$(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
View db_terminate_backend.rake
namespace :db do
desc "Fix 'database is being accessed by other users'"
task :terminate => :environment do
ActiveRecord::Base.connection.execute <<-SQL
mattfreer / bad_template.eex
Last active Oct 12, 2015
Since upgrading to Elixir 1.1 and Eralang 18, I'm noticing that Dialyzer has some issues with String interpolation. This Gist demonstrates an issue with EEx templates that map over a list of Strings
View bad_template.eex
<%= arbitrary_list, fn(item) -> %>
<%= item %>
<%= end %>
mattfreer / width-by-sibling-count.scss
Created Dec 12, 2012
Applies width property to siblings conditionally. Width is applied if the number of siblings matches the supplied sibling-count. This allows developers to set different widths based on the number of siblings. If $sibling-count matches the number-of-siblings then all siblings will be set to an equal percentage width, with a combinded total width …
View width-by-sibling-count.scss
// @param $sibling-selector: selector to target siblings (e.g. h5 | ".simple-filed")
// @param $sibling-count: the number of siblings that must exist in order for these widths to be applied
// @param $fixed-widths: optional keyword argument, list of fixed (percentage) widths to be applied to
// the first-n siblings (e.g. $fixed-widths: 40 30)
// Usage:
// h5 {
// @include width-by-sibling-count(h5, 4, $fixed-widths: 55);
// @include width-by-sibling-count(h5, 5, $fixed-widths: 40);
You can’t perform that action at this time.