Skip to content

Instantly share code, notes, and snippets.

View girliemac's full-sized avatar
📝
Working mostly on writing docs these days

Tomomi ❤ Imura girliemac

📝
Working mostly on writing docs these days
View GitHub Profile
@Fauntleroy
Fauntleroy / gist:9868613
Created March 30, 2014 06:35
geochat issue
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);
@nils-werner
nils-werner / ReadDirAssistant.js
Created June 8, 2011 10:44
Simple FileIO Service for WebOS
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 }; });
}
@davidcalhoun
davidcalhoun / htmlentities.js
Created June 15, 2011 07:43
Shortest HTMLEntities in JavaScript ever
/* 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>'); // '&lt;div id="foo"&gt;bar&lt;/div&gt;'
*/
function HTMLEntities(a) {
var b = document.createElement('a');
@kylebarrow
kylebarrow / bb10viewport.html
Created June 19, 2012 18:50
BB10 Alpha viewport test
<!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"> -->
@tobie
tobie / gist:4668636
Last active December 11, 2015 22:18
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'
@creationix
creationix / bugs.js
Last active December 7, 2016 11:35
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;
@lestrrat
lestrrat / gist:9104980
Last active August 3, 2017 21:55
ヘビメタ英語を日常で使う風景
@codepo8
codepo8 / localstorage.js
Created August 25, 2010 14:44
Store the state of a rendered form the easy way
<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);
@rauchg
rauchg / ms.md
Created December 21, 2011 00:25
Milliseconds conversion utility.