Skip to content

Instantly share code, notes, and snippets.

import { Component } from 'react';
import ReactDOM from 'react-dom';
class InventoryView extends Component {
getTableBodyAsReactElement() {
let inv = [{'upc': 123}, {'upc': 454}];
console.log('inv: ', inv);
return (!inv) ? null : (
<tbody>
/* value_equals.js
The MIT License (MIT)
Copyright (c) 2013-2017, Reactive Sets
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jtara1
jtara1 / np.sh
Created September 17, 2018 22:41
#!/usr/bin/env bash
#############################################
# node profiler
# Runs the Node V8 Profiler
# and analyzes the output after the node app
# exits
# usage example:
# $ sh np.sh index.js --my-flag --my-arg 42 &
# $ pid=$!
# $ kill -s USR1 $pid
import click
import re
def parse_processed_log(processed_log_file):
"""Parse the processed log file from
$ node --prof-process isolate.log > proc.log
Prints and returns the summary
:param processed_log_file: <str>
#!/bin/bash
# ======================
# Check Azure CLI is installed
# ======================
if ! [ -x "$(command -v az)" ]; then
echo 'Error: Azure cli is not installed.' >&2
exit 1
fi
const fs = require('fs');
function toCsv(arrayOfObjects) {
let getProps = (object) => {
return Object.getOwnPropertyNames(object);
};
let props = getProps(arrayOfObjects[0]);
let outputString = props.join(',') + '\n';
@jtara1
jtara1 / compound-word-splitter.js
Created December 11, 2018 19:10
re-implemented a python module, but this actually already exists as a npm module
const _ = require('lodash');
const checkWords = require('check-word');
const englishWords = checkWords('en');
/**
*
* @param character {string}
* @returns {boolean}
*/
function isUpper(character) {
export $(grep -v '^#' .env | xargs)
This file has been truncated, but you can view the full file.
[
[
2,
1,
1,
1,
6,
6,
3,
2,
[
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",
"b",