Skip to content

Instantly share code, notes, and snippets.

View blake41's full-sized avatar

Blake Johnson blake41

  • http://blakejohnson.brandyourself.com/
View GitHub Profile
async function connect() {
// Initializing connection to the NEAR node.
window.near = await nearAPI.connect(Object.assign(nearConfig, { deps: { keyStore: new nearAPI.keyStores.BrowserLocalStorageKeyStore() }}));
// Needed to access wallet login
window.walletAccount = new nearAPI.WalletConnection(window.near);
// Initializing our contract APIs by contract name and configuration.
window.contract = await near.loadContract(nearConfig.contractName, {
viewMethods: ['getCounter'],
LivepeerSDK({provider: 'https://rinkeby.infura.io'}).then(async (sdk) => {
// Once initialized, you can access the methods under the `rpc` namespace
const { rpc } = sdk
// For example, you can get the total supply of Livepeer Tokens like so
const jobs = await rpc.getJobs({broadcaster: '0xa452a1824ac4609Ab93d8b8a442b04847a6Aee01'})
console.log(jobs[0])
})
<html>
<head>
<link rel='stylesheet' href="styles.css" type='text/css'>
</head>
<video controls id="network-video" style="margin-top: 20px" autoplay="" src="http://169.254.95.170:8935/stream/1220b0336cf5c3c34c0a05e5f8d9a6fb8874a091ff47a9546cf748d8e93827b005010bead94a9e2459193bcba1ba726ba331f1c20cf6558d3c129e4e5ec2967f388d.m3u8"></video>
</html>
var canvas = document.getElementById("canvas")
var dataURL = canvas.toDataURL()
// i then display this dataURL doing this
<img src="dataURL">
// this works fine
// then i grab that same data and do
import Web3 from 'web3';
const web3 = new Web3(window.web3.currentProvider);
export default web3;
{
"links": {
"self": "https:\/\/api.stg.dowjones.com\/content\/refs\/drn:archive.webpage.WC93177020170807ed87001p5?article_format=FullArticle"
},
"data": {
"type": "Content",
"id": "WC93177020170807ed87001p5",
"links": {
"redirect": "https:\/\/api.stg.dowjones.com\/content\/refs\/drn:archive.webpage.WC93177020170807ed87001p5\/redirect"
},
{"overview":{"first_name":"Warren","last_name":"Buffett","complete_name":"Warren Edward Buffett","display_name":"Warren Edward Buffett","source_provider":[{"code":"FACSET","descriptor":"FactSet Research Systems Inc.","primary":true}]},"personal_details":[{"memberships":"Bill and Melinda Gates Foundation","is_employee":false,"job_title":"TRUSTEE","name":{"first_name":"Warren","middle_name":"E","last_name":"Buffett","full_name":"Warren E Buffett"},"source_provider":[{"code":"DJGN","descriptor":"Dow Jones Generate","primary":true}],"organization":{"id":"BAMGF"}},{"job_title":"Chairman and Chief Executive Officer","age":83,"name":{"first_name":"Warren","middle_name":"E.","last_name":"Buffett","full_name":"Warren E. Buffett"},"source_provider":[{"code":"DMFCP","descriptor":"MarketLine","primary":true}],"organization":{"id":"BKHT"}},{"is_board_member":true,"job_title":"Chairman & Chief Executive Officer","age":85,"name":{"title":"Mr.","first_name":"Warren","middle_name":"Edward","last_name":"Buffett","full_name":"W
{"data": [
{
"interest_type": "company",
"trending": false,
"definition": "Google Inc",
"code": "gognew"
},
{
"interest_type": "company",
"trending": false,
npm WARN unmet dependency /Users/blake/Documents/Development/dowjones/insight/node_modules/stylelint requires postcss-reporter@'^3.0.0' but will load
npm WARN unmet dependency /Users/blake/Documents/Development/dowjones/insight/node_modules/postcss-reporter,
npm WARN unmet dependency which is version 2.0.0
npm ERR! Darwin 16.5.0
npm ERR! argv "/Users/blake/.nvm/versions/node/v4.2.1/bin/node" "/Users/blake/.nvm/versions/node/v4.2.1/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm v2.14.7
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package react@15.4.2 does not satisfy its siblings' peerDependencies requirements!
sudo stop admittedly-www
# Unset GIT_DIR or the universe will implode
unset GIT_DIR
# Change directory to the working tree; exit on failure
cd `git config --get core.worktree` || exit
# Force checkout
git checkout --force