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
function createNonExtensibleError() { | |
var error = new Error("I am a non-extensible error"); | |
Object.preventExtensions(error); | |
return error; | |
} | |
function handleError(e) { | |
console.log("\nERROR: " + e.message); | |
console.log("--- STACK TRACE BEGIN ---"); | |
console.log(e.stack); |
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 requests | |
class HoverException(Exception): | |
pass | |
class HoverAPI(object): | |
def __init__(self, username, password): | |
params = {"username": username, "password": password} | |
r = requests.post("https://www.hover.com/api/login", params=params) |
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
# The bug below has been fixed in color 1.4 which is | |
# the successor to color-tools 1.3.0 | |
# | |
# There's a bug in color-tools when converting HSL to RGB for desaturated | |
# colors. It doesn't multiple the lightness value by 255, so every resulting | |
# set of RGB values ends up being (1,1,1). This monkeypatch fixes it. | |
class Color::HSL | |
def to_rgb_with_saturation_bugfix(ignored = nil) | |
return Color::RGB.new(*([@l * 0xff] * 3)) if @s <= 1e-5 | |
to_rgb_without_saturation_bugfix(ignored) |