Skip to content

Instantly share code, notes, and snippets.

@nathanhammond
nathanhammond / scroll.html
Created January 4, 2012 07:15
Simplified testcase for jQuery UI Draggable bugs.
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<style type="text/css">
html { overflow-y: scroll; }
.tile td { width: 20px; height: 20px; }
.tile td.full { background: red;}
.board { width: 800px; height: 800px; background: black; }
</style>
@nathanhammond
nathanhammond / Test Results.txt
Created March 1, 2012 04:31
EMCC Test Errors, OS X 10.6.8
======================================================================
ERROR: test_openjpeg (__main__.default)
----------------------------------------------------------------------
Traceback (most recent call last):
File "tests/runner.py", line 4744, in test_openjpeg
make_args=[]) # no -j 2, since parallel builds can fail
File "tests/runner.py", line 275, in get_library
copy_project=True)
File "/Users/nathanhammond/Repos/emscripten/tools/shared.py", line 450, in build_library
stderr=open(os.path.join(project_dir, 'configure_err'), 'w'), env=env)
@nathanhammond
nathanhammond / index.html
Created March 10, 2012 04:36
D3 "Magnets"
<!DOCTYPE html>
<html>
<head>
<title>Force-Directed Layout (Dynamic)</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.geom.min.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.min.js"></script>
<style type="text/css">
html, body {
@nathanhammond
nathanhammond / Manifest.md
Last active December 12, 2015 19:32
ember-cli individual module build

This is the manifest which is produced with the above modifications, highlighting items which don't appear in addons.js. How is it that they're being excluded?

(Some that are being excluded are because of header/footer inclusion, and I want those still.)


  • assets/swtest-app-8eaa577228cc7c7f64c1fa09ff6ce17a
  • assets/vendor-6808ebd858a42103e7a4a5d337433fac
  • bower_components/ember-cli-shims/app-shims-72f67a5d8a070a94eb67eac608340e1c
  • bower_components/ember-data/ember-data.prod-b93cdd76bc224763fa52848ebd4f34bb
@nathanhammond
nathanhammond / qunit-fizzbuzz.html
Created March 15, 2013 16:06
Simple qunit for sharing.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit FizzBuzz</title>
<link rel="stylesheet" href="http://code.jquery.com/qunit/qunit-1.11.0.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
@nathanhammond
nathanhammond / Assetfile
Last active December 20, 2015 23:29
Comparison of an Assetfile that *does* work and a Rakefile invocation of the "same" thing that doesn't work.
output "js"
puts Dir.pwd
input "js" do
match "*.js" do
# concatenate all JS files into a single file
filter Rake::Pipeline::ConcatFilter, "application.js"
end
end
// ==UserScript==
// @name 11-13 TDI SportWagen
// @namespace com.nathanhammond.tdi
// @include http://www.foobert.com/carhunt.html
// @grant none
// @version 1
// ==/UserScript==
Array.prototype.rotate = function( n ) {
this.unshift.apply( this, this.splice( n, this.length ) )
@nathanhammond
nathanhammond / HandlebarsPrecompileFilter.rb
Last active December 22, 2015 07:38
Ember Handlebars precompilation rake-pipeline filter.
class HandlebarsPrecompileFilter < Rake::Pipeline::Filter
include Rake::Pipeline::Web::Filters::FilterWithDependencies
attr_reader :options
def initialize(options={},&block)
block ||= proc { |input| input.sub(/\.handlebars|\.hbs$/, '.hbs.js') }
super(&block)
@nathanhammond
nathanhammond / components.my-component.js
Last active April 26, 2016 17:16
Simple Computed Binding
import Ember from 'ember';
export default Ember.Component.extend({
foo: false,
init: function() {
this._super()
setTimeout(() => {
this.set('foo', true);
}, 1000);
import Ember from 'ember';
export default Ember.Component.extend({
member: 'foo',
bleet(a, b, c) {
console.log('Member bleet!', arguments);
console.log(this.get('foo'));
},
actions: {
bleet(a, b, c) {