This file contains hidden or 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
| /* Using a JavaScript proxy for a super low code REST client */ | |
| // via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg | |
| // also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3 | |
| // also see https://github.com/fastify/manifetch | |
| // also see https://github.com/flash-oss/allserver | |
| // and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
| const createApi = (url) => { | |
| return new Proxy({}, { | |
| get(target, key) { |
terminal:
npm i --save-dev rollup rollup-watch rollup-plugin-typescript typescript typings
npm i -S react react-dom
./node_modules/.bin/typings install react react-dom --save
mkdir src dist
touch src/index.tsx
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 exec = require('child_process').exec, | |
| url = "http://google.com/", | |
| timeout = "3", | |
| data="?q=test"; | |
| var time = process.hrtime(); | |
| exec('curl --max-time ' + timeout + ' -d \'' + data + '\' ' + url, function (error, stdout, stderr) { | |
| var diff = process.hrtime(time); | |
| //console.log('stdout: ' + stdout); | |
| //console.log('stderr: ' + stderr); |
This file contains hidden or 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
| const fs = require('fs'); | |
| const readline = require('readline'); | |
| const { google } = require('googleapis'); | |
| // If modifying these scopes, delete token.json. | |
| const SCOPES = ['https://www.googleapis.com/auth/calendar.readonly']; | |
| // The file token.json stores the user's access and refresh tokens, and is | |
| // created automatically when the authorization flow completes for the first | |
| // time. | |
| const TOKEN_PATH = 'token.json'; |
This file contains hidden or 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
| from flask import Flask, Blueprint, request, current_app, jsonify | |
| import requests | |
| import json | |
| video_blueprint = Blueprint( | |
| 'video', | |
| __name__ | |
| ) |
Data source from https://sites.google.com/site/rlearningsite/catagory/logit Only use for demo & test
This file contains hidden or 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
| chrome.runtime.onMessage.addListener(gotMessage) | |
| function gotMessage(message, sender, sendResponse){ | |
| let direction = 0; | |
| if(message.direction == 'up'){ | |
| direction = -500; | |
| } else if(message.direction == 'down'){ | |
| direction = +500; | |
| } else if (message.direction == 'turn off') { | |
| const mask = document.getElementById('body-maskDiv'); | |
| if (mask) { |
This file contains hidden or 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
| console.log('popup ready!'); | |
| let startPredicting = false; | |
| let times = 0; | |
| let y = 0; | |
| document.addEventListener('DOMContentLoaded', function() { | |
| let video = document.getElementById('video'); | |
| let still = document.getElementById('still'); |
NewerOlder