Skip to content

Instantly share code, notes, and snippets.


John Keefe jkeefe

View GitHub Profile
jkeefe / .eslintrc.js
Created Jan 27, 2021 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
"env": {
"browser": true,
"node": true,
"es6": true
"plugins": ["react"],
"ecmaFeatures": {
jkeefe /
Created Oct 14, 2020
Remove EXIF from images with imagemagick

Removing EXIF

Using Imagemagick:

cd into the directory with lots of images

mogrify -strip ./*.jpg
jkeefe / class_06_block_7.html
Created Oct 1, 2020
Block 7 code for D&D Class 06
View class_06_block_7.html
<html lang="en">
<title>Newmark Bark</title>
<meta name="description" content="latest news">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- import the webpage's stylesheet -->
jkeefe / lambda.js
Created Jun 17, 2020
Code that actually works as a bridge between Twilio & Dialogflow on AWS Lambda
View lambda.js
// 1. This uses claudiajs & its API Gateway to deploy to lambda & handle api post
// 2. Assumes an existing dialogflow project, google cloud project, and google cloud billing
// 3. Got credentials .json file using steps 1-5 (ONLY) here:
// 4. Put that json file in a directory called "sekrets' which I added to .gitignore
// 5. Other helpful options for Google authentication are here:
jkeefe / fish_tank.ino
Created Mar 22, 2020
Fish tank code (see
View fish_tank.ino
#include <Adafruit_NeoPixel.h>
#define PIN1 6
#define PIN2 3
#define NUM_LEDS 60
#define BRIGHTNESS 250
int blue_every = 12; // make every Xth pixel blue
jkeefe /
Created Mar 20, 2020
pymysql connection setup
import pandas as pd
import pymysql
conn = pymysql.connect(host, user=user,port=port,
jkeefe /
Last active Jun 24, 2019 feature importance function for neural nets
# Originally shared by Zachary Mueller here:
# ... which he adapted from Miguel Mota Pinto's post here:
# Assumes all necessary v1.0 libraries are loaded
def feature_importance(learner):
# based on:
data =
jkeefe / encryption.js
Created Dec 16, 2017 — forked from vlucas/encryption.js
Stronger Encryption and Decryption in Node.js
View encryption.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bytes (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', new Buffer(ENCRYPTION_KEY), iv);
jkeefe / index.js
Created Nov 22, 2017
Base index.js file for making lambda functions
View index.js
var twilio = require('twilio');
var mongodb = require('mongodb');
module.exports = function(request) {
return new Promise(function(fulfill, reject){
// functional code goes in here
jkeefe / bot.js
Created Mar 7, 2017
Alexa "color-picker" example form Amazon/Lambda
View bot.js
'use strict';
* This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
* The Intent Schema, Custom Slots, and Sample Utterances for this skill, as well as
* testing instructions are located at
* For additional samples, visit the Alexa Skills Kit Getting Started guide at