Skip to content

Instantly share code, notes, and snippets.

View viveret's full-sized avatar

Viveret Steele viveret

View GitHub Profile
@viveret
viveret / tweet-delete.js
Created September 10, 2023 15:01
Tweet Delete Script
document.querySelectorAll('div/div/div/div/main/div/div/div/div/div/div/div/div/section/div/div/div/div/div/article/div/div/div/div/div/div/div/div/div/div/div/div/div/div/svg'.replaceAll('/', ' > ')).forEach((x, i) => x.closest('div').click())
setTimeout(() => {
testxpath = document.evaluate("//span[text()='Delete']", document, null, XPathResult.ANY_TYPE, null );
let nodes = []; let node; while (node = testxpath.iterateNext()) {nodes.push(node);}
nodes.forEach((x) => x.click());
setTimeout(() => {
testxpath = document.evaluate('/html/body/div/div/div/div/div/div/div/div/div/div/div/div/div/div/div/span/span[text()="Delete"]', document, null, XPathResult.ANY_TYPE, null);
nodes = []; let node; while (node = testxpath.iterateNext()) {nodes.push(node);}
nodes.forEach((x) => x.click());
#ifndef PRODUCER_CONSUMER_QUEUE_HPP_
#define PRODUCER_CONSUMER_QUEUE_HPP_
// Based on code from http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html
// Original version by Anthony Williams
// Modifications by Michael Anderson -- https://gist.github.com/482342
// Modifications by Viveret Steele -- https://gist.github.com/viveret/323d1cadf57468bd73bc97c3b952c124
@viveret
viveret / dotnet-proxy-request-middleware.cs
Created August 26, 2019 17:12
Recipe for proxy request middleware in dotnet core
app.Map("/api/proxied-api", builder => builder.RunProxy(new ProxyOptions {
BackChannelMessageHandler = new ProxyHandler(builder.ApplicationServices),
Scheme = "https",
Host = "localhost",
Port = "44383"
}));
public class ProxyHandler : DelegatingHandler {
private readonly IServiceProvider serviceProvider;
@viveret
viveret / text-sentiment-analysis-using-tiny-dnn.cpp
Last active August 16, 2019 20:13
Text Sentiment Analysis using Tiny DNN and bag-of-words corpus of 12,000 words and 3 classes (positive, negative, neutral). Also uses JSON for modern C++ and Windows Sockets
#include <cstdlib>
#include <iostream>
#include <vector>
#include "tiny-dnn/tiny_dnn/tiny_dnn.h"
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits>
@viveret
viveret / update-messages-with-sample-text-from-file.sql
Last active August 7, 2019 19:05
Template script for updating sanitized messages with sample text from a file for SQL Server
sp_configure 'show advanced options',1
reconfigure;
GO
sp_configure 'Ad Hoc Distributed Queries',1
reconfigure;
GO
CREATE TABLE SampleText (
@viveret
viveret / queer-lingo.json
Last active February 19, 2021 14:27
Queer Lingo
[
{
"uid":1,
"name":"Gender",
"desc_short":"Between the ears, not the legs",
"desc_long":"Gender is the range of characteristics pertaining to, and differentiating between, masculinity and femininity. Depending on the context, these characteristics may include biological sex (i.e. the state of being male, female or intersex), sex-based social structures (including gender roles and other social roles), or gender identity.",
"credit":"en.wikipedia.org/wiki/Gender",
"last_update":"2015-05-11 21:10:00",
"hit_count":72,
"is_slur":false,