This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Idea | |
include MongoMapper::Document | |
key :brilliance, String, :default => "Dark Matter Sucks!" | |
many :ratings | |
belongs_to :user | |
key :user_id, ObjectId | |
def to_s | |
text = "#{user.name} had this IDEA: #{brilliance}\n\tRATINGS:\n" | |
ratings.each do |r| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var eventColors = { | |
mouseover: 'red', | |
mouseout: 'blue', | |
click: 'yellow' | |
} | |
var highlight = function(event) { | |
Event.stop(event); | |
element = Event.element(event); | |
Element.setStyle(element, {backgroundColor: eventColors[event.type]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Duff OMelia (8): | |
Don't use an rvm gemset. | |
Fixed unit test. | |
Upgrade colored gem | |
Don't need the version for map_by_method gem. | |
Don't need to specify a version for the will_paginate_gem. | |
Upgrade the database_cleaner gem. | |
Upgraded mocha gem. | |
Fix exception we just received. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<!-- | |
This is an HTML version of a great [VIM movements cheatsheet][] designed by Ted Naleid. | |
I made this because I wanted more control over the way the text was displayed, and I'd rather tweak CSS than mess with Omnigraffle. If you just want Ted's graphic overlaid on your desktop, you should download the [transparent version] of the VIM movements cheatsheet. | |
I use it with [NerdTool][]. Sadly, NerdTool can't overlay transparent HTML. So I supply a background-image URL. You'll want to change that to something on your local filesystem. Here is a [screenshot][] of the results. The background image is taken from the always great [Bibliodyssey][], resized to the size of my screen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* HSL clock | |
*/ | |
height: 100%; | |
font: bold 5em/1 Helvetica Neue, sans-serif; | |
display: flex; | |
text-align: center; | |
align-items: center; | |
justify-content: center; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var slaying = true; | |
// A bit of new math magic to calculate the odds | |
// of hitting the dragon. We'll cover this soon! | |
var youHit; | |
var damageThisRound; | |
var totalDamage = 0; | |
do { | |
youHit = Math.floor(Math.random() * 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "dual-cjs-mjs-package", | |
"version": "1.0.0", | |
"description": "A package that can be both imported as esm and as cjs", | |
"main": "entry", | |
"scripts": { | |
"build": "babel *.mjs **/*.mjs --out-dir ." | |
}, | |
"devDependencies": { | |
"babel-cli": "^6.26.0", |