Skip to content

Instantly share code, notes, and snippets.

View brittanydionigi's full-sized avatar

Brittany Dionigi brittanydionigi

View GitHub Profile
var Offliner = importScripts('dist/offliner.min.js');
// import here the plug-ins for offliner
var offlinerInstance = new Offliner({
workerUrl: "/path/to/worker-file.js"
});
offlinerInstance.prefetch
.use(/* ... */) // you will find fetchers in the off.fetchers collection
.resources([/* ... */]);

16:52 "if" means
16:52 inverse frequency
16:52 and the unit here is minute
16:53 e.g. if <20 means the user has exhibited that behavior (on average) more than once per 20 minutes
16:53 got it
16:54 and "c" means the number of times the behavior has been exhibited so far (since the installation of the addon)
16:54 so -c >10 -if <20 means the user has done something at least 10 times with a frequency of higher than once per 20 minutes
16:56 ok cool, so let me see if I’m getting this right
16:56 using """+"" button used at least 50 times and if <5 tabs newtab-button -c >50 -if <5” as an example...
16:57 + button used at least 50 times AND with a frequency higher than 5 times per minute

"if" means inverse frequency and the unit here is minute
e.g. "if < 20" means the user has exhibited that behavior (on average) more than once per 20 minutes
so when "if < 5", then "frequency > 1/5"
so it would be higher than once per 5 minutes!

and "c" means the number of times the behavior has been exhibited so far (since the installation of the addon)
so -c > 10 -if < 20 means the user has done something at least 10 times with a frequency of higher than once per 20 minutes

"if" means inverse frequency and the unit here is minute
e.g. "if < 20" means the user has exhibited that behavior (on average) more than once per 20 minutes
so when "if < 5", then "frequency > 1/5"
so it would be higher than once per 5 minutes!

and "c" means the number of times the behavior has been exhibited so far (since the installation of the addon)
so -c > 10 -if < 20 means the user has done something at least 10 times with a frequency of higher than once per 20 minutes

return fetch('http://localhost:8080/api/v2/hb/', {
method: 'POST',
mode: 'cors',
body: JSON.stringify(data),
headers: new Headers({
'Content-Type': 'application/json'
})
})
@brittanydionigi
brittanydionigi / approval-requests.md
Last active May 23, 2016 13:38
approval-requests
We couldn’t find that file to show.

intro

So you just got a little primer on security from Meeka, I'm going to reiterate some of the things she mentioned, mostly that security is hard.

SECURITY MEETUP

I was actually at a node.js meetup last year where someone gave a talk about security and they said when the internet first came around, there was a list of like, 9 or 10 security issues that needed to be addressed that we needed to find a permanent solution for, and as of 2015 not a single one of them had been crossed off the list.

USER AUTH + TRANSMITTING APP DATA

So we are all notorious for sucking as security. But there are some precautions we can take with our apps to at least tryyyyy to make them more secure. As app developers, our main concerns with security are going to be (1) user authentication and (2) transmitting application data in a verifiable and trusted manner.

JWTs

@brittanydionigi
brittanydionigi / primitives.md
Last active February 1, 2017 13:48
js-fundamentals-primitives

Extend the primitive Array data type to allow a groupBy method so that when given an array of objects, you can group each array item by a specified property.

For example, given an array of Turing students:

let students = [
  { name: "Jane", module: "4FE", track: "frontEnd" },
  { name: "Jane", module: "3FE", track: "frontEnd" },
  { name: "Jane", module: "3BE", track: "backEnd" },
  { name: "Jane", module: "4FE", track: "frontEnd" },
@brittanydionigi
brittanydionigi / css-challenge-0206.md
Last active February 6, 2017 19:50
CSS Challenge 02/06

Using just HTML & CSS, create a button with the following hover effect: