Skip to content

Instantly share code, notes, and snippets.

View brentschooley's full-sized avatar

Brent brentschooley

  • Twilio
  • Philadelphia, PA
View GitHub Profile
const { GoogleSpreadsheet } = require("google-spreadsheet");
let fs = require('fs');
let credsFile = Runtime.getAssets()['/creds.json'].path;
let creds = JSON.parse(fs.readFileSync(credsFile, 'utf8'));
async function getCritter(critterName) {
const doc = new GoogleSpreadsheet(process.env.GOOGLE_SPREADSHEET_KEY);
await doc.useServiceAccountAuth(creds);
await doc.loadInfo();
@brentschooley
brentschooley / yt-analytics-to-gsheet.js
Created January 20, 2020 07:13
Code to store YouTube Analytics API data in a Google Sheet (https://youtu.be/DZQWcQ2Z1Tw)
const fs = require("fs");
const readline = require("readline");
const { google } = require("googleapis");
const GoogleSpreadsheet = require('google-spreadsheet');
const { promisify } = require('util');
const scope = ["https://www.googleapis.com/auth/youtube.readonly"];
const creds = require('./client_secret.json');
const doc = new GoogleSpreadsheet(process.env.SPREADSHEET_ID);
@brentschooley
brentschooley / yt-data-to-gsheet.js
Created January 20, 2020 07:11
Code for saving YouTube Data API info to a Google Sheet (https://youtu.be/DZQWcQ2Z1Tw)
const got = require('got');
const GoogleSpreadsheet = require('google-spreadsheet');
const { promisify } = require('util');
const creds = require('./client_secret.json');
const doc = new GoogleSpreadsheet(process.env.SPREADSHEET_ID);
(async () => {
await promisify(doc.useServiceAccountAuth)(creds);
@brentschooley
brentschooley / catgif.js
Created June 12, 2017 17:27
Twilio Function for retrieving cat gifs from The Cat API
exports.handler = function(context, event, callback) {
var client = context.getTwilioClient();
console.log("Sending initial response")
client.messages.create({
to: event.From,
from: event.To,
body: "Fetching a cat for you, one sec..."
}, function(err, res) {
console.log("Sending a cat!")
As the three co-founders of DraftKings, we want to speak to you directly about what has been going on.
We know that you play DraftKings because it's fun and because it gives you a chance to showcase your skills against millions of other fans, and we know that you cannot do that without a level playing field.
The fairness and integrity of our contests has been at the heart of everything we have built since we started the company three and a half years ago.
Over the past week, questions have arisen around an employee of ours who won a significant prize on a competitor's site. While our internal investigation has reflected absolutely no wrongdoing on his part, this has still pushed us to reevaluate our processes.
Long before this happened, the wheels were in motion for an external review of our policies and procedures. Given the pace of our growth, we felt that an audit was critical to ensure the security of our platform, so we hired an external law firm experienced with these issues to conduct a full re
private static string GetCredential(string credential)
{
var credentialValue = ConfigurationManager.AppSettings[credential];
if (String.IsNullOrEmpty(credentialValue))
{
credentialValue = System.Environment.GetEnvironmentVariable(credential, EnvironmentVariableTarget.Machine);
}
return credentialValue;
}
public IGChartView Chart { get; set; }
public NSObject[] Data { get; set; }
public IGCategorySeriesDataSourceHelper Source { get; set; }
public int TotalItems { get; set; }
public Random NumberGenerator { get; set; }
// Add Infragistics and ObjCRuntime
using Infragistics;
using MonoTouch.ObjCRuntime;
@brentschooley
brentschooley / basic-ember-templates.html
Last active December 28, 2015 19:09
Example template for basic Ember.js app without build tools.
<script type="text/x-handlebars">
<h2>Welcome to Ember.js</h2>
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
<ul>
{{#each item in model}}
<li>{{item}}</li>