Skip to content

Instantly share code, notes, and snippets.

Avatar

Viveret Amant viveret

View GitHub Profile
View producer_consumer_queue.hpp
#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 Aug 26, 2019
Recipe for proxy request middleware in dotnet core
View dotnet-proxy-request-middleware.cs
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 Aug 16, 2019
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
View text-sentiment-analysis-using-tiny-dnn.cpp
#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 Aug 7, 2019
Template script for updating sanitized messages with sample text from a file for SQL Server
View update-messages-with-sample-text-from-file.sql
sp_configure 'show advanced options',1
reconfigure;
GO
sp_configure 'Ad Hoc Distributed Queries',1
reconfigure;
GO
CREATE TABLE SampleText (
View queer-lingo.json
[
{
"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,
You can’t perform that action at this time.