Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Morris mtcmorris

  • Melbourne, Australia
View GitHub Profile
@mtcmorris
mtcmorris / game.rb
Last active May 19, 2018
Always lynch randomly
View game.rb
require 'pry'
class Villager
def role_prevents_lynching?
false
end
def werewolf?
false
end
View gist:28f370c327c29a06086b
@mtcmorris
mtcmorris / treasure-war.md
Created Nov 14, 2012
Treasure war readme
View treasure-war.md

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.
View gist:4037500
@-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 Jul 10, 2012
20 top films in the past 5 years
View gist:3082609
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 Feb 13, 2012
link checker styles
View gist:1813634
a.checking {
@include rounded(2px);
color: #bbb;
border-bottom:1px dotted #bbb;
font-size: 15px;
line-height: 16px;
position: relative;
&:before {
position: absolute;
View gist:1392860
@@ -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 Oct 20, 2011
dm belongs_to key problem
View gist:1300214
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 Sep 5, 2011
Mustaches for everyone!!
View gist:1194204
<% 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 Jul 30, 2011
Fix lion libpng
View 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