Skip to content

Instantly share code, notes, and snippets.

@jabez007
jabez007 / Stars&Score_onHover.js
Created March 6, 2019 18:11
A userscript for StockFlare that shows the individual star ratings for a stock when hovering over the stock ticker in the search results
// ==UserScript==
// @name Stars&Score onHover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Show the StockFlare stars and StockInvest score onHover
// @author jabez007
// @match https://stockflare.com/stocks
// @grant none
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @require https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js
@jabez007
jabez007 / ObjectWithACL.js
Created February 20, 2019 13:06
Creates a JavaScript object with Firebase like '.read'/'.write' properties from a given object
function withACL(obj) {
const __properties__ = {};
if (typeof(obj) === 'object') {
Object.keys(obj)
.forEach((key) => {
Object.defineProperty(this, key, {
get() {
if (!!__properties__[key].value) {
return __properties__[key].value;
@jabez007
jabez007 / rDailyProgrammer.js
Created January 29, 2019 18:05
Scrape the current Daily Programmer challenges
fetch("https://www.reddit.com/r/dailyprogrammer/").then((resp) => resp.text()).then((text) => {
let parser = new DOMParser();
let doc = parser.parseFromString(text, "text/html");
doc.querySelectorAll("a.SQnoC3ObvgnGjWt90zD9Z").forEach((a) => console.log(a.href));})
@jabez007
jabez007 / Program.cs
Last active January 17, 2019 20:04
A C# implementation for a Python-like List object
using System;
namespace SliceableList
{
class Program
{
static void Main(string[] args)
{
var myList = new PyList<int>()
{
@jabez007
jabez007 / Disable-SSL.ps1
Last active October 18, 2018 19:02
Disables SSL 2.0 and SSL 3.0 while enabling TLS 1.1 and TLS 1.2
# disable SSL 2.0
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server' -name Enabled -value 0 –PropertyType DWORD
# disable SSL 3.0
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0\Server' -name Enabled -value 0 –PropertyType DWORD
# enable TLS 1.1
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server' -Force
New-Item 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Client' -Force
New-ItemProperty -path 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.1\Server' -name 'Enabled' -value 1 –PropertyType DWORD
@jabez007
jabez007 / XmlDocumentationDirectoryProvider.cs
Created June 22, 2018 12:56
A class to provide documentation to ASP.NET Web API Help Pages from a directory containing XML documentation files
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Web.Http.Controllers;
using System.Web.Http.Description;
using System.Xml.Linq;
using System.Xml.XPath;
namespace WebApi.Explorer
@jabez007
jabez007 / SigningPdf.cs
Created April 23, 2018 19:48
Adding a digital and visible signature to a PDF
using iTextSharp.text;
using iTextSharp.text.pdf;
using iTextSharp.text.pdf.security;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Security;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
@jabez007
jabez007 / BlogHub.cs
Last active April 18, 2018 20:53
Using SignalR share a form and track cursors
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using Microsoft.AspNet.SignalR;
using Microsoft.AspNet.SignalR.Hubs;
namespace MultiEditWithSignalRv2.SignalR
@jabez007
jabez007 / WaitForThreads.cs
Created April 4, 2018 21:48
ThreadPool WaitForThreads
/// <summary>
/// https://www.codeproject.com/articles/8398/wait-for-threads-in-a-threadpool-object-to-complet
/// Blocks until all worker threads have returned to the thread pool.
/// A good timeout value is 30 seconds.
/// </summary>
protected void WaitForThreads()
{
int maxThreads = 0;
int placeHolder = 0;
int availThreads = 0;
@jabez007
jabez007 / Email.cs
Created April 3, 2018 17:35
Send internal email "anonymously"
using System.Net.Mail;
namespace EmailAnon
{
public class AnonEmail
{
private static readonly string smtpHost = "";
private static readonly string smtpDomain = "";
public static void Send(string to, string subject, string message)