Skip to content

Instantly share code, notes, and snippets.

View jamesshore's full-sized avatar

James Shore jamesshore

View GitHub Profile
"use strict";
const CommandLine = require("./infrastructure/command_line");
const Rot13 = require("./logic/rot13");
module.exports = class App {
constructor(commandLine, rot13) {
this._commandLine = commandLine;
this._rot13 = rot13;
@jamesshore
jamesshore / REPRO.js
Last active September 11, 2015 18:17
Demonstrates a weird bug in Firefox that causes getComputedValue().getPropertyValue() to return wrong results when called twice in a row
// by James Shore letscodejavascript.com Released to public domain
(function() {
"use strict";
var PROPERTY = "border-top-left-radius"; // padding-left exhibits problem too
var VALUE = "20px";
createFrame(document.body, function(frame) {
var domElement = document.createElement("div");
@jamesshore
jamesshore / Gruntfile.js
Last active January 3, 2016 19:39
Michal Svoboda's port of [Automatopia](https://github.com/jamesshore/automatopia) to Grunt. See [this comment thread](http://www.letscodejavascript.com/v3/comments/lab/1#comment-1206272962) for context.
/* global module */
(function() {
"use strict";
module.exports = function(grunt) {
var shellOptions = { stdout: true, stderr: true, failOnError: true };
@jamesshore
jamesshore / jTypes-Object-Playground
Created July 23, 2013 18:27
The [jTypes](http://www.jtypes.com/) front-page example, formatted for visualizing on [Object Playground](http://www.objectplayground.com/).
/*! ------------------------------------------------------------------------
// jTypes 2.1.1
// ------------------------------------------------------------------------
//
// Copyright 2013 Gaulinsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// You might expect it to look like this:
public static Rot13String load(String filename) throws IOException {
return new Rot13String(_fileSystem.read(filename));
}
public void saveAs(String filename) throws IOException {
_fileSystem.overwrite(filename, _string);
}