Skip to content

Instantly share code, notes, and snippets.

View ravinggenius's full-sized avatar
🤔
likely thinking

Thomas Ingram ravinggenius

🤔
likely thinking
View GitHub Profile
{
"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",
@ravinggenius
ravinggenius / dragon.js
Last active August 10, 2016 23:55 — forked from Jingram17/dragon.js
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);
@ravinggenius
ravinggenius / dabblet.css
Created December 15, 2014 20:01 — forked from LeaVerou/dabblet.css
HSL clock
/**
* HSL clock
*/
height: 100%;
font: bold 5em/1 Helvetica Neue, sans-serif;
display: flex;
text-align: center;
align-items: center;
justify-content: center;
@ravinggenius
ravinggenius / vimshortcuts.html
Created October 11, 2011 22:41 — forked from dsanson/vimshortcuts.html
an HTML VIM movement cheatsheet for use with NerdTool
<!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.
@ravinggenius
ravinggenius / gist:976834
Created May 17, 2011 16:51 — forked from ntalbott/gist:958220
git log --no-merges --pretty=short --since="2011-04-25" --until="2011-05-01" | git shortlog
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.
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]});
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|