Skip to content

Instantly share code, notes, and snippets.

View gtracy's full-sized avatar

Greg Tracy gtracy

View GitHub Profile
@gtracy
gtracy / ssh identity stash for private repos
Last active August 29, 2017 15:58
npm install : Provide access to private npm packages in Github
eval "$(ssh-agent -s)"
eval ssh-add ~/.ssh/id_rsa
Enter passphrase for /Users/developer/.ssh/id_rsa:
Identity added: /Users/developer/.ssh/id_rsa (/Users/developer/.ssh/id_rsa)
npm install
@gtracy
gtracy / easypost-scrape.js
Created April 9, 2017 16:38
EasyPost tracker history to CSV
const async = require('async');
const Easypost = require('node-easypost');
const csv = require('fast-csv');
const fs = require('fs');
const stream = require('stream');
var start_date = new Date('2017-03-01');
var easypost_key = 'fixme';
@gtracy
gtracy / google.js
Created December 22, 2019 15:41
Google Drive API
const config = require('../config');
const {google} = require('googleapis');
const Google = function() {
var self = this;
this.sheets = google.sheets({
version: 'v4',
auth: config.googleAPI.key
@gtracy
gtracy / slurpy.js
Created July 12, 2020 19:32
Tweet dowload script
const Twit = require('twit')
const async = require('async');
/*
* ASSUMES YOU'VE STASHED YOUR TWEETS FROM A TWITTER DOWNLOAD HERE
*
* found in your twitter download @ /data/tweet.js
*/
const tweets = require('./tweets-old');
@gtracy
gtracy / csvToDynamo.js
Created October 25, 2022 00:38
Import CSV file into DynamoDB
'use strict';
//
// core logic for importing and transforming a CSV dataset, and
// storing the results in a Dynamo table
//
const Fs = require('fs');
const CsvReadableStream = require('csv-reader');
const prompt = require('prompt-sync')({sigint: true});
@gtracy
gtracy / bootDynamo.js
Created October 25, 2022 00:46
Create a new DynamoDB table from NodeJS
'use strict';
/***********************************************/
// configure these values for your Dynamo table
//
const TABLE_NAME = 'FIXME';
const table_params = {
TableName : TABLE_NAME,
KeySchema: [