Skip to content

Instantly share code, notes, and snippets.

View mtcmorris's full-sized avatar

Michael Morris mtcmorris

  • Melbourne, Australia
View GitHub Profile
@mtcmorris
mtcmorris / game.rb
Last active May 19, 2018 00:42
Always lynch randomly
require 'pry'
class Villager
def role_prevents_lynching?
false
end
def werewolf?
false
end
@mtcmorris
mtcmorris / gist:28f370c327c29a06086b
Created August 24, 2014 02:38
Rails Girls Melbourne
@mtcmorris
mtcmorris / treasure-war.md
Created November 14, 2012 09:22
Treasure war readme

Treasure War

Inspired by brains - write a bot that finds treasure, kills people and claims glory.

Game rules

  1. You spawn at your stash.
  2. You can navigate and pick up treasure which you can return to your stash for 10 points.
  3. Players can steal treasure from your stash and you lose 10 points.
  4. You earn 1 point for each player you kill.
@mtcmorris
mtcmorris / gist:4037500
Created November 8, 2012 08:15
Just beat it.
@-webkit-keyframes pulse {
0% { font-size: 1em; }
30% { font-size: 1em; }
35% { font-size: 1.4em; }
40% { font-size: 1em; }
50% { font-size: 1em; }
55% { font-size: 1.4em; }
60% { font-size: 1em; }
100% { font-size: 1em; }
}
@mtcmorris
mtcmorris / gist:3082609
Created July 10, 2012 10:42
20 top films in the past 5 years
The Artist
Senna
Hanna
Headhunters (Hodejegerne)
The Help
Best Exotic Marigold Hotel
District 9
Crazy Stupid Love
The Social Network
Black Swan
@mtcmorris
mtcmorris / gist:1813634
Created February 13, 2012 04:18
link checker styles
a.checking {
@include rounded(2px);
color: #bbb;
border-bottom:1px dotted #bbb;
font-size: 15px;
line-height: 16px;
position: relative;
&:before {
position: absolute;
@mtcmorris
mtcmorris / gist:1392860
Created November 25, 2011 05:18
DM AR diff
@@ -138,29 +138,12 @@ class Content < ActiveRecord::Base
)
end
- # DataMapper made me do it, sorry baby Jesus.
- def self.search(keywords, options = {})
- options = {
- conditions: ["true"]
- }.merge(options)
-
@mtcmorris
mtcmorris / gist:1300214
Created October 20, 2011 01:48
dm belongs_to key problem
require 'dm-core'
require 'dm-migrations'
require 'dm-validations'
DataMapper.setup :default, "sqlite::memory"
class User
include DataMapper::Resource
property :id, Serial
has 1, :image
@mtcmorris
mtcmorris / gist:1194204
Created September 5, 2011 06:06
Mustaches for everyone!!
<% if current_user_is_editor? %>
<%= content_for :footer do %>
<script type="text/javascript">
$(document).ready(function() {
$("article.vcard img").each(function(index, img) {
$(img).attr("src", "http://mustachify.me/?src=" + "http://theconversation.edu.au" + $(img).attr("src"));
});
});
</script>
<% end %>
@mtcmorris
mtcmorris / lion-libpng
Created July 30, 2011 01:24
Fix lion libpng
Fixing Lion libpng issues
-------------------------
Until this issue https://github.com/mxcl/homebrew/issues/4468 is resolved installing Lion screws up ImageMagick's png support. The following steps are a hacky work around to get things going again. `identify: memory allocation failed` is the error message you'll receive before applying the fix.
brew uninstall imagemagick
cd /usr/X11R6/lib
sudo mv libpng.dylib libpng.old.dylib
sudo ln -s libpng12.0.dylib libpng.dylib
brew install imagemagick