Skip to content

Instantly share code, notes, and snippets.

View jwdb's full-sized avatar

Jan-Willem de Bruyn jwdb

View GitHub Profile
@jwdb
jwdb / HijackProperty.cs
Created January 31, 2024 12:34
HijackProperty
// Example Usage:
// class FakeDateTime {
// public DateTime UtcNow => DateTime.Parse("1970-01-01");
// }
//
// using (var hijack = new HijackProperty(typeof(DateTime), "UtcNow", typeof(FakeDateTime))) {
// Console.WriteLine($"It's currently: {DateTime.Now}");
// }
public class HijackProperty : IDisposable
@jwdb
jwdb / 100-0-ordered-includingnonletters.txt
Created September 12, 2019 12:29
shakespeare complete world ordered including non letters
View raw

(Sorry about that, but we can’t show files that are this big right now.)

@jwdb
jwdb / 100-0-ordered.txt
Created September 12, 2019 12:27
shakespeare complete work ordered
This file has been truncated, but you can view the full file.
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@jwdb
jwdb / Program.cs
Last active March 27, 2019 07:56
TGBot in one line because @baaakaaaaaaaaa didn't believe me
using System.IO;using Telegram.Bot.Helper;using Telegram.Bot;using Telegram.Bot.Types.Enums;using Telegram.Bot.Types.ReplyMarkups;namespace TGBotLiner{class Program{static void Main(string[] args){TelegramBotHelper _h;_h=new TelegramBotHelper(()=>new TelegramBotClient(File.ReadAllText("token.txt")));_h.Client.OnUpdate+=async(o,e)=>{await _h.UpdateReceived(e.Update);};_h.Messages(_m=>{_m["/start"]=async(m,_)=>{await _h.Client.SendTextMessageAsync(m.Chat.Id,"Hello in my test bot!",replyMarkup:new ReplyKeyboardMarkup(new KeyboardButton("About")));};_m["About"]=async(m,_)=>{await _h.Client.SendTextMessageAsync(m.Chat.Id,"This bot was created by Psyonity.");};});_h.Client.StartReceiving(allowedUpdates:new[]{UpdateType.Message,UpdateType.CallbackQuery});}}}
@jwdb
jwdb / gist:8776a97d748012bf86c8d8135d6bd311
Created October 18, 2017 07:45
well forged spam mail
Delivered-To: **FILTERED**
Received: by 10.223.158.202 with SMTP id b10csp5873288wrf;
Wed, 18 Oct 2017 00:31:17 -0700 (PDT)
X-Received: by 10.80.173.150 with SMTP id a22mr19021704edd.49.1508311877462;
Wed, 18 Oct 2017 00:31:17 -0700 (PDT)
ARC-Seal: i=5; a=rsa-sha256; t=1508311877; cv=pass;
d=google.com; s=arc-20160816;
b=No9CLudckTtLulEfCLh/5wHRb+/9F9duWYvMq5RuxM247ZUo9FNo+TQb/cDpaEN1O7
gK4uckihZgX5w/kaxhaUSbZzF4AoLH45Ix5PIWX5YJHLDryWkMLmyrsKnMinMFIGpEa1
DE8wTlPzt2adn8TRq11Fsyv9OOFlNW8Qm9BNyvCdB4FQoBY30v5yabQdI2T5mh5d5yKl
@jwdb
jwdb / somethingFishy.md
Created July 13, 2017 07:52
I smell something fishy here
Attention Dear,

I know it is because of your past experience that make you not to believe me but I told you before that I cannot deceive you because my bible says what shall it profit a man to gain material things and loose your soul, any way their is good news now, i raised some money to help you out and make sure that your payment will be release to you the same day you send the $105.00 as well. I borrowed money yesterday after service from my Pastor, then you have to send the remain balance now only $105.00 but i don't see the reason why you have keep silent on me not to respond back, honestly I am just disappointed at your behaviors before because you know that I can not deceive you, Just pay the $105.00 and leave rest for me watching me if I am telling you lies or not.Your payments is already approval today for you to receive it but the management here says that you must pay $105.00 for the Stamp and activation charge before you can receive the payment today, please send the charge through western u
@jwdb
jwdb / ConditionalWeakTable.cs
Created January 12, 2017 15:32
ConditionalWeakTable
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// ==++==
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// ==--==