Skip to content

Instantly share code, notes, and snippets.

Jim Cummins jimthedev

Block or report user

Report or block jimthedev

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jimthedev
jimthedev / index.js
Last active Jul 2, 2018
precalculate.tree
View index.js
const expect = require("expect");
const nav = {
children: [
{
text: "Home",
link: "/home",
children: [
{
text: "About",
@jimthedev
jimthedev / README.md
Last active Jun 22, 2018
Label Service Toc
View README.md

Welcome to our readme. Check out Google.

View services.json
{
"services": [
{
"id": 12345,
"slug": "label-service",
"name": "Label Service",
"docs": "https://raw.githubusercontent.com/jimthedev/example-svc-docs/master/"
},
{
"id": 91234,
@jimthedev
jimthedev / iota.seed.generate.js
Created Aug 23, 2017
iota in browser seed generate with javascript including testing of distribution
View iota.seed.generate.js
const distr = {};
let x = 1000;
while(x--) {
const nums = Array.from(crypto.getRandomValues(new Uint8Array(65536)).filter(n => n < 27).slice(0, 81));
nums.forEach(n => distr[n] = distr[n] ? distr[n] + 1 : 1);
}
console.log(distr);
@jimthedev
jimthedev / apollo.umd.js
Last active Aug 11, 2017
apollo-client 1.8 v 1.9
View apollo.umd.js
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('whatwg-fetch'), require('graphql/language/printer'), require('redux'), require('graphql-anywhere'), require('symbol-observable'), require('apollo-link-core')) :
typeof define === 'function' && define.amd ? define(['exports', 'whatwg-fetch', 'graphql/language/printer', 'redux', 'graphql-anywhere', 'symbol-observable', 'apollo-link-core'], factory) :
(factory((global.apollo = {}),null,global.graphql_language_printer,global.Redux,global.graphqlAnywhere,global.$$observable,global.apolloLinkCore));
}(this, (function (exports,whatwgFetch,graphql_language_printer,redux,graphqlAnywhere,$$observable,apolloLinkCore) { 'use strict';
graphqlAnywhere = graphqlAnywhere && graphqlAnywhere.hasOwnProperty('default') ? graphqlAnywhere['default'] : graphqlAnywhere;
$$observable = $$observable && $$observable.hasOwnProperty('default') ? $$observable['default'] : $$observable;
function isStringValue(value) {
@jimthedev
jimthedev / github.graphql
Created Jul 19, 2017
gleb's repos w/descriptions & tags
View github.graphql
# Use this at https://developer.github.com/v4/explorer/
query {
user(login: "bahmutov") {
repositories(first: 100) {
nodes {
description
repositoryTopics(first: 100) {
nodes {
topic {
@jimthedev
jimthedev / index.js
Created Jun 22, 2017
An example micro service using 'micro' that installs an actual development cert to avoid browser SSL errors
View index.js
const https = require('https')
const { run, send } = require('micro')
const getDevelopmentCertificate = require('devcert-san').default;
async function startServer() {
const PORT = process.env.PORT || 3443;
let ssl;
if (!process.env.NODE_ENV || process.env.NODE_ENV === 'development') {
try {
@jimthedev
jimthedev / bookmarklet.js
Created Jun 20, 2017
see midwestjs speakers
View bookmarklet.js
javascript:(function()%7B var style %3D document.createElement(%27style%27), styleContent %3D document.createTextNode(%27%23main-content>div %7B overflow-y: visible !important%3B overflow-x: visible !important%3B white-space: normal !important%3B %7D .speaker-details %7B float: inherit !important%3B overflow: visible !important%3B %7D%27)%3B style.appendChild(styleContent )%3B var caput %3D document.getElementsByTagName(%27head%27)%3B caput%5B0%5D.appendChild(style)%3B %7D)()%3B
@jimthedev
jimthedev / index.js
Last active Apr 20, 2017
How to extract comments out of html using Cheerio
View index.js
const htmlString = `
<!doctype html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
<meta charset="utf-8">
<title>css</title>
<meta name="description" content="CSS parser / stringifier">
You can’t perform that action at this time.