Skip to content

Instantly share code, notes, and snippets.

View fdebijl's full-sized avatar

Floris de Bijl fdebijl

View GitHub Profile
@fdebijl
fdebijl / parser.js
Last active February 28, 2018 13:25
ProPublica - parser.js
const timeline = node => {
// Controleer of het element ergens het woord 'Gesponsord' bevat
// zo weten we of het om een advertentie gaat of niet.
const sponsor = checkSponsor(node);
// Als blijkt dat het element geen advertentie is dan wordt deze weggegooid
if (!checkSponsor(node)) return Promise.resolve(false);
// Hier gebeuren twee dingen tegelijkertijd: de functie getTimelineId()
// haalt het ID van de advertentie op en kijkt op wie de advertentie is gericht (stap 3a).
// Ondertussen draait de functie cleanAd() om alle persoonsgegevens uit de advertentie
@fdebijl
fdebijl / content.js
Last active February 26, 2018 15:17
ProPublica - content.js
// Reclame's in de tijdlijn zelf hebben deze klasse
const TIMELINE_SELECTOR = ".userContentWrapper";
// Reclame's in de sidebar krijgen deze klasse
const SIDEBAR_SELECTOR = ".ego_unit";
// Deze functie wordt elke vijf seconden uitgevoerd om alle reclames op de
// pagina te versturen naar het achtergrondscript (later meer uitleg hierover)
const sendAds = function() {
let posts = Array.from(document.querySelectorAll(SIDEBAR_SELECTOR)).concat(
Array.from(document.querySelectorAll(TIMELINE_SELECTOR))
@fdebijl
fdebijl / index-unmin.html
Last active February 21, 2018 20:30
Flip-a-coin
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Flip a coin</title>
<style>
@import url(https://fonts.googleapis.com/css?family=Inconsolata);
@fdebijl
fdebijl / keybase.md
Created April 7, 2017 09:37
Keybase Verification

l (https://keybase.io/fdebijl) on keybase.

  • I have a public key ASBhFXwTX-stfe77UeYp4XfxKjXjNiDh2pasLaTD6leifAo

To claim this, I am signing this object:

{
    "body": {
        "key": {
            "eldest_kid": "012061157c135feb2d7deefb51e629e177f12a35e33620e1da96ac2da4c3ea57a27c0a",