Skip to content

Instantly share code, notes, and snippets.

💭
Being awesome

Rob Janssen RobThree

View GitHub Profile
View gist:6a0ed026a4b9bbd2f488fdf7e7841c3e
Verifying my Blockstack ID is secured with the address 1LF6MBuM2XTJxAoqCWBHo59ZqQ5EXUaBKs https://explorer.blockstack.org/address/1LF6MBuM2XTJxAoqCWBHo59ZqQ5EXUaBKs
@RobThree
RobThree / custom.css
Last active Apr 23, 2019
Maak je Tweakers.net frontpage weer bruikbaar
View custom.css
/* Automatisch spoilers tonen bij hover */
div.spoiler:hover {
color: white !important;
}
/* Quotes donkerder dan posts */
.message-quote-div {
background-color: #dddede !important;
border: 1px solid #c8c8c8 !important;
color: #000 !important;
@RobThree
RobThree / DocumentOperationRoleRequirementsFilter.cs
Created Sep 21, 2018
Swashbuckle.AspNetCore DocumentOperationRoleRequirementsFilter
View DocumentOperationRoleRequirementsFilter.cs
using Microsoft.AspNetCore.Authorization;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Linq;
using System.Reflection;
using System.Web;
namespace MyNameSpace {
public class DocumentOperationRoleRequirementsFilter : IOperationFilter
{
@RobThree
RobThree / gameconsole.cs
Created Oct 17, 2017
OneLoneCoder GameConsole inspired C# version; work in progress and not a 1:1 conversion. API differs, tried to stay more close to dotnet best practices.
View gameconsole.cs
using Microsoft.Win32.SafeHandles;
using System;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;
namespace ConsoleEngine
{
@RobThree
RobThree / bitmap2ascii.cs
Created Sep 18, 2017
A simple bitmap-to-ascii-art converter featuring configurable fonts, configurable chars, configurable dimension (width) etc.
View bitmap2ascii.cs
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
public class Bitmap2Ascii
{
@RobThree
RobThree / check.cs
Last active Sep 14, 2017
C# implementation of the FNV-1 and FNV-1a hashes (http://www.isthe.com/chongo/tech/comp/fnv/)
View check.cs
// Test/check FNV-1(a) hash implementations
var testvectors = new[] { "", "a", "b", "c", "d", "e", "f", "fo", "foo", "foob", "fooba", "foobar", "\0", "a\0", "b\0", "c\0", "d\0", "e\0", "f\0", "fo\0", "foo\0", "foob\0", "fooba\0", "foobar\0", "ch", "cho", "chon", "chong", "chongo", "chongo ", "chongo w", "chongo wa", "chongo was", "chongo was ", "chongo was h", "chongo was he", "chongo was her", "chongo was here", "chongo was here!", "chongo was here!\n", "ch\0", "cho\0", "chon\0", "chong\0", "chongo\0", "chongo \0", "chongo w\0", "chongo wa\0", "chongo was\0", "chongo was \0", "chongo was h\0", "chongo was he\0", "chongo was her\0", "chongo was here\0", "chongo was here!\0", "chongo was here!\n\0", "cu", "cur", "curd", "curds", "curds ", "curds a", "curds an", "curds and", "curds and ", "curds and w", "curds and wh", "curds and whe", "curds and whey", "curds and whey\n", "cu\0", "cur\0", "curd\0", "curds\0", "curds \0", "curds a\0", "curds an\0", "curds and\0", "curds and \0", "curds and w\0", "curds and wh\0
@RobThree
RobThree / gist:b7ee02338024beb7a2fbfd14e9a060b2
Last active Jan 27, 2019
My AdBlock Plus custom filters
View gist:b7ee02338024beb7a2fbfd14e9a060b2
9gag.com###overlay-container
9gag.com###sidebar
9gag.com##.badge-sticky-button
9gag.com##.post-meta
9gag.com##.share
flabber.nl###footer
flabber.nl##.block-block
flabber.nl##.carousel
flabber.nl##.news-box
flabber.nl##.post:nth-child(4)
@RobThree
RobThree / tarpit.php
Created Dec 5, 2016
PHP Tarpit response
View tarpit.php
<?php
$response = <<<EOD
HTTP/1.1 {{status}}
Server: {{server}}
Date: {{gmdate}}
Content-Type: text/html; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
<!doctype html>
<html lang="en">
View 1-WeightedObjectPickerExample.cs
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
// Demo
static void Main(string[] args)
{
// Define some weighted object (in this case: strings, but could be anything (e.g. "Customer") and set their weights
@RobThree
RobThree / temps.py
Last active May 30, 2016
Python script that runs a webservice that returns readings from DS18B20 temperature sensors connected to a Raspberry Pi as JSON data for al sensors or a specific sensor
View temps.py
#!/usr/bin/env python
# You will need to have web.py installed. To install, run: pip install web.py
# How to install as service: http://blog.scphillips.com/posts/2013/07/getting-a-python-script-to-run-in-the-background-as-a-service-on-boot/
# Should the above page be offline; a mirror is at: http://archive.is/20160529210455/http://blog.scphillips.com/posts/2013/07/getting-a-python-script-to-run-in-the-background-as-a-service-on-boot/
# You can run this as:
# python temps.py
# This will run the service on port 8080; # Optionally, you can specify a port:
You can’t perform that action at this time.