Re: http://twitter.com/hondallica/status/436117998823165952
クソコードを見たとき: "Looking at this code is pure agony!"
同僚がバグを直してくれた時: "You are an angel sent to save me!"
Uncaught exception: Error: Firebase.child failed: First argument was an invalid path: "null". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]" | |
Error thrown at line 3, column 2 in g(a) in https://cdn.firebase.com/v0/firebase.js: | |
throw a; | |
called from line 275, column 2 in Ia(a, b) in https://cdn.firebase.com/v0/firebase.js: | |
(!u(b) || 0 === b.length || ya.test(b)) && g(Error(A(a, 1, l) + 'was an invalid path: "' + b + '". Paths must be non-empty strings and can\'t contain ".", "#", "$", "[", or "]"')) | |
called from line 3844, column 4 in <anonymous function: H.prototype.F>(a) in https://cdn.firebase.com/v0/firebase.js: | |
Ia("Firebase.child", a); | |
called from line 106, column 2 in createUserNode(username) in https://dl.dropboxusercontent.com/u/1330446/geochat/js/scripts.js: | |
userRef = allUserRef.child(username); |
var ReadDirAssistant = function() { | |
} | |
ReadDirAssistant.prototype.run = function(future) { | |
var fs = IMPORTS.require("fs"); | |
var path = this.controller.args.path; | |
fs.readdir(path, function(err, files) { future.result = { path: path, files: files }; }); | |
} |
/* From Ben McMahan: | |
http://www.quora.com/What-are-the-most-interesting-HTML-JS-DOM-CSS-hacks-that-most-web-developers-dont-know-about/answer/Ben-McMahan | |
Example usage: | |
HTMLEntities('<div id="foo">bar</div>'); // '<div id="foo">bar</div>' | |
*/ | |
function HTMLEntities(a) { | |
var b = document.createElement('a'); |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>Screen Test</title> | |
<meta charset="utf-8"> | |
<!-- | |
Default device width vieport: | |
BB10 Alpha viewport width = 768px | |
--> | |
<!-- <meta name="viewport" content="width=device-width"> --> |
Test Framework Requirements | |
=========================== | |
- Single URL to W3C Framework. | |
- Ability to use the framework to run the tests locally. | |
- Ability to define and run test suites for specific profiles. | |
- Single test run. | |
- Ability to run testharness.js, ref and manual tests. | |
- Reporting individual and aggregated results. | |
- Allow browser vendors to run the tests as part of their CI strategy. |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sass: { | |
compile: { | |
options: { | |
style: 'compressed' | |
}, | |
files: { | |
'styles/screen.css': 'styles/screen.scss' |
var neopixelWrite = require('ESP8266').neopixelWrite; | |
var count = 120; | |
var pixels = new Uint8Array(count * 3); | |
function update() { | |
neopixelWrite(14, pixels); | |
} | |
function dampen(p) { | |
var i = (p % count) * 3; | |
pixels[i]>>>=1; | |
pixels[++i]>>>=1; |
Re: http://twitter.com/hondallica/status/436117998823165952
クソコードを見たとき: "Looking at this code is pure agony!"
同僚がバグを直してくれた時: "You are an angel sent to save me!"
<script> | |
// test for localStorage support | |
if(('localStorage' in window) && window['localStorage'] !== null){ | |
var f = document.getElementById('mainform'); | |
// test with PHP if the form was sent (the submit button has the name "sent") | |
<?php if(isset($_POST['sent']))){?> | |
// get the HTML of the form and cache it in the property "state" | |
localStorage.setItem('state',f.innerHTML); |