Skip to content

Instantly share code, notes, and snippets.

@cannona
cannona / gist:4ec4080c07555731c80abbb0c82c2d0f
Created August 14, 2017 21:27
All the commands available to Firebase functions
!
.
:
[
[
[[
]]
{
}
2to3
@cannona
cannona / index.js
Created August 14, 2017 21:23
A quick and dirty Firebase function for discovering what linux commands are available to functions.
var functions = require('firebase-functions');
var exec = require('child_process').exec;
exports.getInfo = functions.https.onRequest((req, res) => {
exec("/bin/bash -c 'compgen -c'", (...args) => {
res.json(args);
});
});
@cannona
cannona / index.html
Created May 1, 2015 21:30
Accessible Table Example // source http://jsbin.com/jamina
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<meta charset="utf-8">
<title>Accessible Table Example</title>
<style id="jsbin-css">
.ascending .when-descending, .descending .when-ascending {
display: none;
}
@cannona
cannona / gist:5316590
Created April 5, 2013 04:15
Convert a flat JS object into a nested set of objects and arrays.
var nester = (function () {
/**
* Selected Keys from Object
*
* @param object obj The object from which you want to get the keys.
* @param array ignoredKeys keys to ignore.
* @return array the non-ignored keys of the object.
*/
var selectedKeysFromObject = function (obj, ignoredKeys) {
var ignoredKeysObj = {};
@cannona
cannona / install.html
Created June 20, 2012 01:04
Bookmarklet for converting Esperanto characters in text fields written in the x-system to their true Unicode equivalents.
<html>
<head>
<title>x-system conversion bookmarklet</title>
</head>
<body>
<p>
To install the bookmarklet, right-click the following link, and select "bookmark this link".
</p>
<p>
<a href="javascript:(function(a){a&&(a.type==="text"||a.type==="textarea")&&(a.value=a.value.replace(/([cghjsu])x/gi,function(a,b){return{C:"\u0108",c:"\u0109",G:"\u011c",g:"\u011d",H:"\u0124",h:"\u0125",J:"\u0134",j:"\u0135",S:"\u015c",s:"\u015d",U:"\u016c",u:"\u016d"}[b]}))}(document.activeElement))">