Skip to content

Commit

Permalink
chore: update wordings
Browse files Browse the repository at this point in the history
  • Loading branch information
shatgupt committed Sep 18, 2018
1 parent accea95 commit 6cc8487
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 64 deletions.
44 changes: 0 additions & 44 deletions dashboard.html
Expand Up @@ -46,8 +46,6 @@ <h4 id="after-ext-install" class="hide">Great! Now that you have installed the e
<p id="user-email"></p>
<p>Your API Key</p>
<p id="key"><input id="show-key" class="btn" type="button" value="Show Key"></p>
<h4 id="usage"><input id="get-usage" class="btn" type="button" value="Get Usage"></h4>
<p><strong>Note:</strong> Usage data might be <a href="faq.html#usage-delay">delayed</a> by few minutes to hours</p>

<div class="menu">
<ul>
Expand Down Expand Up @@ -77,54 +75,12 @@ <h4 id="usage"><input id="get-usage" class="btn" type="button" value="Get Usage"
location.assign('/' + location.search)
})

const usage = $('#usage')
const getUsage = $('#get-usage')
if (location.search.indexOf('ext-install=1') !== -1) {
$('#after-ext-install').classList.remove('hide')
} else if (location.search.indexOf('key-gen=1') !== -1) {
// disable usage on first time till 30s to avoid getting 403 from APIG
$('#after-key-gen').classList.remove('hide')
getUsage.disabled = true
getUsage.setAttribute('title', 'Usage available only after 30 seconds of signup')
setTimeout(() => {
getUsage.disabled = false
getUsage.setAttribute('title', '')
}, 30000)
}

const usageUrl = `https://api.runmycode.online/keyusage?id=${user.id}&name=${encodeURIComponent(user.email)}`
getUsage.addEventListener('click', (e) => {
usage.classList.remove('error')
usage.textContent = 'Getting Usage...'
fetch(usageUrl, {
headers: {'x-api-key': user.key}
})
.then(res => res.json())
.then(resp => {
if (!resp.error) {
const usageArr = resp.usage
if (usageArr.length !== 0) {
// Usage format is monthlyUsage[dailyUsage[usedThatDay, totalRemaining]]
let totalUsage = 0
let remaining = usageArr[usageArr.length-1][1]
for(let day of usageArr) totalUsage += day[0]
usage.textContent = `You have used ${totalUsage} runs of your monthly ${totalUsage+remaining} limit`
} else {
console.warn('empty usage response', resp)
usage.innerHTML = 'No usage data available yet. <a href="codesheet.html">May be run some code?</a>'
}
} else {
console.error('Error:', resp)
usage.classList.add('error')
usage.textContent = `Error: ${resp.error}`
}
})
.catch((error) => {
console.error('Error:', error)
usage.classList.add('error')
usage.textContent = 'Some error happened. Please try again later.' // what else do I know? :/
})
})
</script>
</body>
</html>
36 changes: 16 additions & 20 deletions faq.html
Expand Up @@ -35,19 +35,19 @@ <h2><a href="/">RunMyCode</a></h2>
<main>
<h3 class="text-center">Frequently Asked Questions</h3>

<h4 id="why"><a href="#why">#</a> Why did you make this?</h4>
<h4 id="why"><a href="#why">#</a> Why did you create this?</h4>
<p>RunMyCode Online has been primarily made for developers to quickly tinker with code. The aim is to enable developers to test a piece of code directly from browser without installing anything.<br>
Some use cases include:
<ul>
<li>For professors - <a href="https://github.com/blog/2376-how-to-grade-programming-assignments-on-github">Grading programming assignments</a> directly on Github in browser</li>
<li>For students - Reading, writing and even executing programming assignments all from Github in browser without worrying about installing compilers or git</li>
<li>For developers - Quickly run code you are browsing on Github</li>
<li>Run small piece of code online from a browser through <a href="codesheet.html">CodeSheet</a></li>
<li>For developers - Quickly run code you are browsing on Github.</li>
<li>For professors - <a href="https://github.com/blog/2376-how-to-grade-programming-assignments-on-github">Grading programming assignments</a> directly on Github in browser.</li>
<li>For students - Reading, writing and even executing programming assignments all from Github in browser without worrying about installing compilers or git.</li>
<li>Run small piece of code online from a browser through <a href="codesheet.html">CodeSheet.</a></li>
</ul>
</p>

<h4 id="api-use"><a href="#api-use">#</a> Can I use RunMyCode Online API in my own app?</h4>
<p>Yes, you can. But please do not use the RunMyCode Online hosted version in production or anything that can implode universe. It is not meant be. Also, there are time and network restrictions in the hosted version. Since all code is open source, I would suggest to host the service yourself if you are going to use this heavily and don't want any limits.</p>
<p>Yes, you can. But please do not use the RunMyCode Online hosted version in production or anything that can implode universe. It is not meant be. Also, there are time and network restrictions in the hosted version. Since all code will be open source soon, I would suggest to host the service yourself if you are going to use this heavily and don't want any limits.</p>

<h4 id="auth"><a href="#auth">#</a> Why do I need to authenticate?</h4>
<p>RunMyCode Online is a free service by a single developer. To restrict abuse, a key is required to use it. Your key will be generated once you authenticate yourself using any of the auth providers on the home page. This service only needs access to name and email and once the key is generated, you can immediately revoke RunMyCode Online's access from the auth provider. <a href="#privacy-policy">Concerned about your data?</a></p>
Expand All @@ -57,17 +57,16 @@ <h4 id="key-use"><a href="#key-use">#</a> How is the key used?</h4>

<h4 id="limits"><a href="#limits">#</a> What are the limitations?</h4>
<ul>
<li>Code should be a standalone program in a single file</li>
<li>1000 runs per month</li>
<li>5 seconds time limit for each run</li>
<li>No internet access from code</li>
<li>Code should be a standalone program in a single file.</li>
<li>5 seconds time limit for each run.</li>
<li>No internet access from code.</li>
</ul>

<h4 id="browser-ext"><a href="#browser-ext">#</a> Which browser extensions are available?</h4>
<ul>
<li><a href="https://chrome.google.com/webstore/detail/runmycode-online/iidcnkpdmnopbbkdmneglbelcefgfohf">Google Chrome</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/runmycode-online">Mozilla Firefox</a></li>
<li>Opera - Use <a href="https://addons.opera.com/en/extensions/details/download-chrome-extension-9/">this Opera extension</a> to install the Chrome version</li>
<li>Opera - Use <a href="https://addons.opera.com/en/extensions/details/download-chrome-extension-9/">this Opera extension</a> to install the Chrome version.</li>
</ul>

<h4 id="config-ext"><a href="#config-ext">#</a> How do I configure the extension?</h4>
Expand Down Expand Up @@ -101,24 +100,21 @@ <h4 id="supported-sites"><a href="#supported-sites">#</a> What are the supported
<li><a href="https://bitbucket.org/snippets/shatgupt/jykE9">Bitbucket Snippets</a></li>
</ol>

<h4 id="usage-delay"><a href="#usage-delay">#</a> Why delay in usage data?</h4>
<p>That is how AWS API Gateway reports it.</p>

<h4 id="privacy-policy"><a href="#privacy-policy">#</a> Privacy Policy OR How is my data used/stored?</h4>
<ul>
<li>Only your name and email are accessed from auth provider and stored</li>
<li>Name and email are used just to associate with a key</li>
<li>No mail will be sent to your email unless there is an abuse detected</li>
<li>No code run is stored unless there is an abuse detected</li>
<li>Some data might be collected by Google Analytics</li>
<li>Only your name and email are accessed from auth provider and stored.</li>
<li>Name and email are used just to associate with a key.</li>
<li>No mail will be sent to your email unless there is an abuse detected.</li>
<li>No code run is stored unless there is an abuse detected.</li>
<li>Some data might be collected by Google Analytics.</li>
<li>Any more concerns? Please email to <a href="mailto:support@runmycode.online">support@runmycode.online</a></li>
</ul>

<h4 id="logout"><a href="#logout">#</a> Will I be able to use RunMyCode Online after I logout?</h4>
<p>Yes. You can still use already configured browser extensions. Logout simply deletes data stored by RunMyCode Online website. You won't be able to use <a href="codesheet.html">CodeSheet</a> though. You will get the same key if you log back in.</p>

<h4 id="delete-account"><a href="#delete-account">#</a> How do I delete my account?</h4>
<p>To prevent possible abuse, currently there is no delete button on the site. Please email to <a href="mailto:support@runmycode.online">support@runmycode.online</a> with the email id you authenticated with. Sorry for this inconvenience.</p>
<p>To prevent possible abuse, currently there is no delete button on the site. Please email to <a href="mailto:support@runmycode.online">support@runmycode.online</a> with the email id you authenticated with. Apologies for this inconvenience.</p>

<h4 id="source"><a href="#source">#</a> Where is the source code?</h4>
<ul>
Expand Down

0 comments on commit 6cc8487

Please sign in to comment.