Skip to content

Instantly share code, notes, and snippets.

View funador's full-sized avatar

Jesse Heaslip funador

View GitHub Profile
@funador
funador / ham.js
Created September 28, 2017 23:15
// take the last 100 tweets from the user
{
accountAge: 4,
mins: 2880, // number of mins to get to 100 tweets
frequentLen: 4, // When they retweet the same account more than 4 times per hundred ++
totalFreq: 81, // Total count of above
convos: 3, // number of tweets directed at another user
listed_count: 23, // how often they are listed
numOriginalTweets: 9, // how many of the 100 are created by the tweeter
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
const request = require('request')
const hmacSha384 = require('crypto-js/hmac-sha384')
const btoa = require('btoa')
const pubKey = 'my-pub-key'
const priKey = 'my-pri-key'
const data = JSON.stringify({'hello': 'world'})
// Hash the data with the private key then Base64 encode
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter:
// =====================================================
// 1.
// Write a function called `doubleIt` which accepts a `num`
// parameter (type: number) and returns double the provided number
// Test #1
// const result1 = doubleIt(10);
// console.log(result1); // => 20
// =====================================================
function doubleIt(num){
// ================================================================================
// You will be writing a series of functions beneath each block of comments below.
// Tackle each function one at a time. You may move on to a new exercise and return
// later. Run the code and the console to the right will tell you if your function
// is successfully passing the tests.
// ================================================================================
/*
Define a function named `kmToMiles` that receives one parameter: