Skip to content

Instantly share code, notes, and snippets.

View mich-cook's full-sized avatar
:octocat:
building, creating, doing, wheee!

mich mich-cook

:octocat:
building, creating, doing, wheee!
  • US-CA-Las Vegas
View GitHub Profile
@mich-cook
mich-cook / lambda.js
Created January 21, 2021 04:33
Minimal working version of call to AWS lambda to keep handy so I can screw up the one on my machine, er, I mean experiment with it.
const AWS = require("aws-sdk");
// Get soopur seekrit vars from .env file.
require("dotenv").config(); // could test response, but out of scope for simplicity
const REGION = process.env.REGION;
const IDENTITY_POOL_ID = process.env.IDENTITY_POOL_ID;
const FUNCTION_NAME = process.env.FUNCTION_NAME;
// Init cognito
AWS.config.region = REGION;
@mich-cook
mich-cook / ri-data.json
Last active August 14, 2020 22:10 — forked from planetoftheweb/ri-data.json
Locally controlled copy of data used for demo project
[
{
"petName": "Pepe",
"ownerName": "Reggie Tupp",
"aptNotes": "It's time for this rabbit's post spaying surgery checkup",
"aptDate": "2018-11-28 13:30"
},
{
"petName": "Rio",
"ownerName": "Philip Ransu",
@mich-cook
mich-cook / columnRemoveExample.js
Last active December 9, 2019 11:25
JavaScript snippet to hide unused activity columns in the 100k challenge "Your Meter Log" table in the Athlete Portal. Showing columns of 0s makes the table unnecessarily wide. columnRemoveExample.js is compatible with the existing markup that's in production on 09Dec19.
//
// this version uses the bottom row to find columns with a toal of 0.00m
// and then hides the cells in all rows with the same column offsets
//
// it would be tempting to optimize this by moving the query selector
// for the strong element to the top, but that will mess up the offsets
//
// there's probably a clever way to make the inner querySelectorAll()
// more compact, but I couldn't find it quickly
//
@mich-cook
mich-cook / github-setup.sh
Last active March 26, 2019 02:40
github setup
# cliff notes versions of a few of the github help pages to get started
git config --global user.email "mich-cook@users.noreply.github.com"
# a possible place to get a random passphrase: http://randomtextgenerator.com/
ssh-keygen -t rsa -b 4096 -C "`git config user.email`" -f ~/.ssh/github # keep that passphrase handy!
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github # here's why you saved the passphrase
#
# STOP! this is a step done in the browser and required to continue
# paste and save contents of ~/.ssh/github.pub here: https://github.com/settings/ssh/new
@mich-cook
mich-cook / calledButNotCalled.spec.js
Created October 3, 2011 22:07
The spy missed its chance to report a call.
(function() {
var MYAPP = {};
window = jsdom().createWindow(),
$ = require('jquery').create(window),
document = window.document,
jQuery = $j= $;
$('body').html('<div class="click-me"></div>');
@mich-cook
mich-cook / test_broken.spec.js
Created September 12, 2011 18:55
A test that loops over values doesn't work if it's the first one.
describe('Testing some characters', function() {
var chars = ['&', '\'', '"', '<', '>'];
for(var i = 0; i < chars.length; i+=1) {
currentChar = chars[i];
it('should reject ' + currentChar, (function(currentChar) {
expect(false).toEqual(false);
})(currentChar));
}
});
@mich-cook
mich-cook / gist:710604
Created November 22, 2010 20:24 — forked from ydn/gist:389725
Contextual search module that I checked in under ydn account. Forked so I have a pointer to it
//
// This block of code creates the YDN Rack module that supports searching within
// a set of docs. Previously, the only search functionality would scour the entire
// site for the terms entered. This module aims to provide contextual search
// within documentation so a user can more easily find something related to the
// docs currently being presented. We use a bunch of y! technology to do the heavy
// lifting and that's awesome that we just have to manufacture the glue.
//
@mich-cook
mich-cook / puppies.html
Created November 13, 2010 21:09
This is the code that I built up for my YUI + YQL presentation at BarCamp Philadelphia. Slides of the buildup (bits of this code) are here: http://slidesha.re/dqTOlB
<html>
<head>
<title>YUI/YQL Flickr</title>
<style type="text/css">
.yui-carousel-element li { height: 75px; width: 75px; }
.yui-carousel-element .yui-carousel-item-selected { border: none; }
</style>
</head>
<body class="yui3-skin-sam">