Skip to content

Instantly share code, notes, and snippets.

View InsiderPhD's full-sized avatar

Katie Paxton-Fear InsiderPhD

View GitHub Profile
@InsiderPhD
InsiderPhD / csrf-attack_csrf.html
Last active March 12, 2024 08:49
CSRF PoC Example for YT
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form id = "csrf_form" method = "POST" action = "http://127.0.0.1:8000/user/name">
<input type = "text" name = "name" value = "hhh">
<form>
@InsiderPhD
InsiderPhD / SecretSanta.php
Created December 3, 2019 12:55
A laravel command which generates secret santa matches based on matching location preferences
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Collection;
class SecretSantaPairing extends Command
{
#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
# http://shiny.rstudio.com/
#
library(dplyr)
@InsiderPhD
InsiderPhD / knossos_vis.R
Created April 9, 2018 09:35
ggpage Visualisation for Toponyms at Knossos
library(tidyverse)
library(ggpage)
tablets$text <- as.character(tablets$inscription)
tablets_long <- subset(tablets, nchar(as.character(tablets$inscription)) >15, type = "chars")
knossos <- tablets_long[grep("KN", tablets$location, ignore.case=T),]
knossos$text <- gsub("-", "", as.character(knossos$inscription))
knossos <- knossos[complete.cases(knossos),]
head(knossos, 100) %>%
@InsiderPhD
InsiderPhD / OrQuery.py
Created March 26, 2018 10:54
Works with the InvertedIndex.py
# OR query
searchQuery = "about company"
searchTokens = tokeniser.tokenize(searchQuery)
searchNormalised = list()
for t in searchTokens:
searchNormalised.append(porter.stem(t))
postingsList = list()
for t in invertedIndex:
for search in searchNormalised:
import nltk
# sample BooleanIR inverted index
document1 = "I started with my company about six months ago. They hired myself and my boss at the same time but due to her work load they had me helping with her workload and not the job I was recruited and hired for. During this time my boss was always trying to be my friend and have conversations with me so she was well aware I was trying to have a baby. In January they hired a third person and have had me training her how to do all the elements of the job so I could do the job I was hired for. My boss and I had a specific conversation in January when I thought I was pregnant and she asked me the following day if I was. We also had a conversation where I was concerned I was training my replacement and I would have no job security and she assured me I was not."
document2 = "Fast forward to this week. I am pregnant and told her on Thursday so I would be able to go to Dr. appts etc. she still continued to have me write down all my processes, knowledge etc. Then on