This file contains 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
import tensorflow as tf | |
import numpy as np | |
import matplotlib.pyplot as plt # used to show a graph of the data | |
# random data to find a formula from | |
trainX = np.asarray(np.linspace(0, 2, 30)) | |
trainY = 2 * trainX + np.random.randn(trainX.shape[0]) * 0.33 | |
# used in operations later |
This file contains 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 options = { | |
url: 'https://oauth.reddit.com/api/v1/me', // the endpoint to hit | |
headers: { | |
'Authorization': 'bearer <YOUR ACCESS TOKEN>', | |
'User-Agent': '<YOUR USER AGENT HERE>' | |
} | |
} | |
request(options, (error, response, body) => { | |
if (error) { |
This file contains 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 buffer = new Buffer(app_client_id + ':' + app_client_secret).toString('base64') | |
var auth = 'Basic ' + buffer | |
var options = { | |
url: 'https://www.reddit.com/api/v1/access_token', | |
form: { | |
"grant_type": "password", | |
"username": reddit_username, | |
"password": reddit_password | |
}, |