Skip to content

Instantly share code, notes, and snippets.

export function CategoryFlyout({ visible }) {
+ // Always render links in the DOM for bots, for SEO purposes
+ const renderWhenHidden = currentUser().isBot;
+
+ if (!visible && !renderWhenHidden) {
+ return null;
+ }
+
const classes = classNames(
'category-flyout',
@meshulam
meshulam / CategoryFlyout-Before.tsx
Last active April 7, 2021 18:37
CategoryFlyout demo
export function CategoryFlyout({ visible }) {
const classes = classNames(
'category-flyout',
{ 'category-flyout--visible': visible },
);
return (
<div className={classes} role="dialog" aria-hidden={!visible}>
{/* heading, links, image, etc */}
</div>
@meshulam
meshulam / cjp-article.html
Created June 28, 2017 01:18
Example article for creating interactive location info UI
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title>Chicago Justice Project - Data portal</title>
<link href="http://data.chicagojustice.org/site.css" rel="stylesheet" type="text/css" />
<link type="text/css" href="http://data.chicagojustice.org/css/custom-theme/jquery-ui-1.8.15.custom.css" rel="Stylesheet" />
<script type="text/javascript" src="http://data.chicagojustice.org/js/jquery-1.6.2.min.js"></script>
<script type="text/javascript" src="http://data.chicagojustice.org/js/jquery-ui-1.8.15.custom.min.js"></script>
@meshulam
meshulam / apiarytest.html
Created January 4, 2017 21:27
Isolated test showing iOS display issues with embedded apiary docs
<!doctype html>
<html>
<head>
<title>Apiary test</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { margin: 0; }
.header,
@meshulam
meshulam / json-table-transform.js
Created September 26, 2016 16:39
Transform an array-of-arrays style JSON table file (with header row) into an array-of-objects format
'use strict';
const fs = require('fs');
const files = process.argv.slice(2);
function transformRow(row, headers) {
let outObj = {};
for (let i=0; i<headers.length; i++) {
outObj[headers[i]] = row[i];
}
int numSends; // counter to count number of sends to Cloud
void setup() {
// put your setup code here, to run once:
SerialCloud.begin(115200);
SerialUSB.begin(9600);
SerialUSB.println("Hello Cloud example has started...");
numSends = 0; // count number of sends
}
@meshulam
meshulam / event-replay.py
Created November 19, 2015 16:56
Replay JSON events from a file into TempoIQ
import base64
import argparse
import httplib
import os
import sys
import time
# run 'python event-replay.py -h' to see usage.
# set default environment info here if you don't want to put it on the command
@meshulam
meshulam / blender_shortcuts.rst
Last active August 29, 2015 14:19
Blender Shortcuts

Blender Shortcut Cheatsheet

Navigation:

  • Rotate - MMB-drag
  • Pan - Shift-MMB-drag
  • Zoom - Wheel or Ctrl-MMB-drag

Numpad navigation:

import dateutil.parser
import optparse
from Queue import Queue
from tempodb.client import Client
from tempodb.protocol import DataPoint
from threading import Thread
class Worker(Thread):
"""Thread executing tasks from a given tasks queue"""