Skip to content

Instantly share code, notes, and snippets.

View JoshuaCaputo's full-sized avatar
🥕
JS

Joshua Caputo JoshuaCaputo

🥕
JS
View GitHub Profile
@JoshuaCaputo
JoshuaCaputo / cognition.js
Created January 27, 2019 20:37
Allows to call functions outside of scope and make inferred decision. v0,1
/**
* These groupings give positive or negative inflection to the words
*/
const cognition = {
positive: ['bright', 'pleased', 'kind', 'amused', 'up', 'exposed'],
negative: ['disapproval', 'displeasure', 'down']
}
@JoshuaCaputo
JoshuaCaputo / AWS_S3_File_Upload.js
Last active June 29, 2018 05:58 — forked from homam/AWS_S3_File_Upload.js
How to upload files to AWS S3 with NodeJS SDK
var AWS = require("aws-sdk");
var fs = require('fs');
s3 = new AWS.S3();
// For dev purposes only
AWS.config.update({ accessKeyId: '...', secretAccessKey: '...' });
// Read in the file, convert it to base64, store to S3
fs.readFile('del.txt', function (err, data) {
if (err) { throw err; }
@JoshuaCaputo
JoshuaCaputo / PivotControls.js
Created October 5, 2017 18:45
THREE.PivotControls
/**
* @author be9concepts / https://github.com/be9concepts (10/05/17)
*/
// This set of controls performs orbiting, dollying (zooming).
//
// Orbit - directional keys / mousewheel drag
// Zoom - mousewheel scoll
// # var controls = new THREE.PivotControls(camera, document.documentElement);
@JoshuaCaputo
JoshuaCaputo / angle-between-points.js
Last active July 11, 2018 06:54 — forked from conorbuck/angle-between-points.js
JavaScript: Find the angle between two points
var angleBetweenPoints = function(p1, p2, rad){ // vector2, vector2, bool
if (!p1 || !p2){
return false;
}
// format angle in radians
var angleRadians = Math.atan2(p2.y - p1.y, p2.x - p1.x);
// format angle in degrees
var angleDegrees = angleRadians * 180 / Math.PI;
// return formatted angle