Skip to content

Instantly share code, notes, and snippets.

View birdsarah's full-sized avatar

Sarah Bird birdsarah

View GitHub Profile
@birdsarah
birdsarah / iso_countries.json
Last active March 15, 2022 16:48
Clean dataset of ISO 3166-1 alpha-2 codes to ISO 3166-1 alpha-3 codes.
[
{
"country_name": "Central African Republic (the)",
"country_code_2": "CF",
"country_code_3": "CAF"
},
{
"country_name": "Congo (the)",
"country_code_2": "CG",
"country_code_3": "COG"
@birdsarah
birdsarah / print_addrs.cpp
Created February 9, 2021 00:19
Printing out iface ip addresses
#include <stdio.h>
#include <unistd.h>
#include <string.h> /* for strncpy */
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#include <arpa/inet.h>
@birdsarah
birdsarah / singlefile-settings.json
Created November 3, 2020 05:22
Settings for single file that stop optimizations like removing unused tags
{
"profiles": {
"__Default_Settings__": {
"removeHiddenElements": false,
"removeUnusedStyles": true,
"removeUnusedFonts": true,
"removeFrames": false,
"removeImports": false,
"removeScripts": true,
"compressHTML": false,
@birdsarah
birdsarah / plotting_utils.py
Last active August 5, 2020 00:50
bokeh plotting helper functions
import bokeh.io as bkio
import bokeh.layouts as bkl
import bokeh.models as bkm
import bokeh.palettes as bkpa
import bokeh.plotting as bkp
import bokeh.transform as bkt
import matplotlib.cbook as cbook
import pandas as pd
from IPython.display import Image
@birdsarah
birdsarah / fetch_lists.py
Last active April 17, 2020 23:05
Functions to get site lists
# std lib
import tempfile
import lzma
# external dependencies
import requests
import pandas as pd
def _get_list_as_dataframe(listname):
resp = requests.get(listname)
@birdsarah
birdsarah / openwpm-summary-program-2.txt
Created March 27, 2020 19:05
OpenWPM summary including JS callstacks for a program:2 hit
REQUEST (IN REQUEST TABLE)
incognito 0
crawl_id 4054084083
visit_id 295627631120017
extension_session_uuid 48cf84d1-752c-49a5-b510-c8864df077cc
event_ordinal 251
window_id 1
tab_id 1
frame_id 0
@birdsarah
birdsarah / openwpm-summary-dna-min.txt
Created March 27, 2020 19:03
OpenWPM summary including JS callstacks for a dna.min hit.
REQUEST (IN REQUEST TABLE)
incognito 0
crawl_id 392629134
visit_id 84683434077219
extension_session_uuid eface96b-1f73-4f40-a265-200ed9cc0746
event_ordinal 42
window_id 1
tab_id 1
frame_id 0
@birdsarah
birdsarah / openwpm-summary-dna-persist.txt
Created March 27, 2020 18:57
OpenWPM summary including JS callstacks for a dna-persist hit.
REQUEST (IN REQUEST TABLE)
incognito 0
crawl_id 2398498099
visit_id 71415980951849
extension_session_uuid 951563f3-cfb9-4926-a066-038b49467c4c
event_ordinal 767
window_id 1
tab_id 1
frame_id 4294967318
@birdsarah
birdsarah / forter-script-processed.js
Last active May 12, 2020 00:06
Source of https://15912b5d40f0.cdn4.forter.com/sn/15912b5d40f0/script.js on Mar 27, 2020 - formatted for readability and with some context added in top comment
/*
Found on mattressfirm.com
<script type="text/javascript" id="ftr__script" async="" src="https://15912b5d40f0.cdn4.forter.com/sn/15912b5d40f0/script.js"></script>
Then heavily processed using the code here: https://github.com/mozilla/script_review_utils/tree/master/wet-script
Objects are dereferenced essentially "wetting" the code and making many variables useless.
Tries to remove "unused" variable declarations to keep the code shorter.
This processing may well have bugs.
*/
//dna-persist.min_2.2.1
var DnaUOL=function(){function t(){this.closure=[],this.uid=null,this.instanceId={},this.hasAlarm=!1,this.updateTimeout=3e3,this.unloadBinded=!1,this.version="2.2.1",this.hasSupport=function(){var e=!0;if("sessionStorage"in window)try{sessionStorage.setItem("hasSupport",""),sessionStorage.removeItem("hasSupport")}catch(t){e=!1}else e=!1;return e}()}function a(){if(f.hasSupport&&"dnaThread"in sessionStorage){var e=[],t=sessionStorage.getItem("dnaThread");if("finished"==t)sessionStorage.setItem("dnaThread",""),e=[];else try{e=JSON.parse(t)}catch(t){e=[]}for(var a=-1,r=[],i={},n=f.closure.concat(e),o=0;o<n.length;o++){var s=!1;"id"in n[o]&&(n[o].id in i?n[o].update>i[n[o].id].update&&(s=!0):s=!0),s&&(i[n[o].id]=n[o],n[o].update>a&&(a=n[o].update))}for(var c in i)r.push(i[c]);f.closure=r}}function r(){if(f.hasSupport&&"finished"!=sessionStorage.getItem("dnaThread")){var e=!1;if(f.closure.length>0){for(var t=u(),a=0;a<f.closure.length;a++)f.closure[a].update=t;var r=JSON.stringify(f.closure