This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Originally shared by Zachary Mueller here: | |
# https://forums.fast.ai/t/feature-importance-in-deep-learning/42026/16 | |
# ... which he adapted from Miguel Mota Pinto's post here: | |
# https://medium.com/@mp.music93/neural-networks-feature-importance-with-fastai-5c393cf65815 | |
# Assumes all necessary fast.ai v1.0 libraries are loaded | |
def feature_importance(learner): | |
# based on: https://medium.com/@mp.music93/neural-networks-feature-importance-with-fastai-5c393cf65815 | |
data = learner.data.train_ds.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var twilio = require('twilio'); | |
var mongodb = require('mongodb'); | |
module.exports = function(request) { | |
return new Promise(function(fulfill, reject){ | |
// functional code goes in here | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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 http://amzn.to/1LzFrj6 | |
* | |
* For additional samples, visit the Alexa Skills Kit Getting Started guide at | |
* http://amzn.to/1LGWsLG | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from https://claudiajs.com/news/2016/11/22/claudia-bot-builder-2.7.1-alexa-skills.html | |
// The list of platform names can include: | |
// facebook, slackSlashCommand, telegram, skype, twilio, kik, groupme, viber, alexa. | |
const botBuilder = require('claudia-bot-builder'); | |
module.exports = botBuilder(function (message, originalApiRequest) { | |
return `I got ${message.text}`; | |
}, { platforms: ['alexa'] }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# John Keefe’s global git ignore | |
.DS_Store | |
.AppleDouble | |
.LSOverride | |
.env | |
*.log | |
scratch.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// question-bot! | |
var twilio = require('twilio'); | |
var mongodb = require('mongodb'); | |
module.exports = function(request) { | |
return new Promise(function(fulfill, reject){ | |
// functional code goes in here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var questionbot = require('./index'); | |
var ApiBuilder = require('claudia-api-builder'); | |
var api = new ApiBuilder(); | |
module.exports = api; | |
api.post('/question-bot', function(request){ | |
// bulding the reply (repsonse) | |
// which first sends the request object to sparkbot for processing | |
return questionbot(request) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title>Earthquakes Map: Last month</title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.1/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.12.1/mapbox-gl.css' rel='stylesheet' /> | |
<style> | |
body { margin:0; padding:0; } |