Skip to content

Instantly share code, notes, and snippets.

View bruceharris's full-sized avatar

Bruce Harris bruceharris

View GitHub Profile

This example has moved to .

@bruceharris
bruceharris / README.md
Last active January 3, 2016 06:29 — forked from mbostock/.block
@bruceharris
bruceharris / README.md
Last active December 21, 2015 08:39
Does Meteor namespacing work as documented?

Meteor namespacing, specifically package scope variables, don't seem to work as described in the namespacing section of the docs.

From what I can tell, when the var keyword is omitted, actual globals are created. (I'm running 0.6.5)

To run this:

$ meteor create globalcheck

then copy these files into globalcheck (overwriting the default files)

package net.bruceharris.test.inheritance;
import static org.junit.Assert.assertEquals;
import org.junit.Assert;
import org.junit.Test;
public class InheritanceTest {
private Child c = new Child();
@bruceharris
bruceharris / index.html
Created December 15, 2012 23:55
objectDiff
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.2.0/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script>
@bruceharris
bruceharris / index.md
Created December 12, 2012 04:13
JavaScript's Prototype System

JavaScript's Prototype System

When I ask interview candidates to explain what prototypes mean in JavaScript, the response is often something like this

Here's my attempt to explain it succinctly.

I think it's important to draw the distinction between 2 related concepts: the prototype property of functions, and the prototype of an object

The prototype property of functions

@bruceharris
bruceharris / 02.asciidoc
Created July 30, 2012 19:46
JavaScript I - Variables, Functions, and Scope

JavaScript II - Objects, Arrays and Booleans

Content and target audience

JavaScript II - Objects, Arrays, and Booleans

Laying the foundation for object oriented programing in JavaScript.

@bruceharris
bruceharris / index.html
Created July 30, 2012 16:21
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodePen &middot; A Pen by bruceharris</title>
<!--
Copyright (c) 2012 Bruce Harris, http://codepen.io/bruceharris
Permission is hereby granted, free of charge, to any person obtaining
@bruceharris
bruceharris / index.html
Created July 30, 2012 13:44
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CodePen &middot; A Pen by bruceharris</title>
<!--
Copyright (c) 2012 Bruce Harris, http://codepen.io/bruceharris
Permission is hereby granted, free of charge, to any person obtaining