This file contains hidden or 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
moduleKeywords = ['included', 'extended', 'prototype'] | |
class Class | |
# Rename an instance method | |
# | |
# ``` coffeescript | |
# class User | |
# @alias "methods", "instance_methods" | |
# | |
# ``` |
This file contains hidden or 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
{exec} = require 'child_process' | |
task "build", "Compile all CoffeeScript to JavaScript", -> | |
exec 'coffee --bare --compile --join persistence-test.js ' + | |
("#{file}.coffee" for file in ["utilities", "persistence", "test"]).join(" "), | |
(err, stdout, stderr) -> | |
throw err if err | |
console.log stdout + stderr |
This file contains hidden or 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
require 'redcarpet' | |
# Custom handler that raises error. | |
# | |
module Redcarpet | |
module Render | |
class Crasher < HTML | |
def paragraph(text) | |
raise "Error!" | |
end |
This file contains hidden or 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
import Tone from 'tone' | |
const bpm = 120.0 | |
const QUARTER_NOTE_MS = 60000.0 / bpm | |
var lastTime | |
Tone.Transport.bpm.value = bpm; | |
// Measure time delta since last call, warn if early or late |