Skip to content

Instantly share code, notes, and snippets.

View RobThree's full-sized avatar
🤙
Being awesome

Rob Janssen RobThree

🤙
Being awesome
View GitHub Profile
@RobThree
RobThree / introrx.md
Last active August 29, 2015 14:06 — forked from staltz/introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@RobThree
RobThree / WordTableExtractor.cs
Created February 19, 2015 17:33
Word table extractor
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Xml;
//Usage:
// var tables = new WordTableExtractor().ExtractTables(@"path\to\my\file.docx");
@RobThree
RobThree / ObjectMerger.php
Created May 21, 2015 17:09
Class used to merge objects based on a specific syntax specified as strings
<?php
/**
* Dynamically merges objects; it allows for string-values to be 'expanded' into actual object values following a simple
* syntax: $objectname.property or $objectname.property.property.property[foo] or $objectname[1]
*
* Example:
*
* $source = array('customer' => $customerobject, 'order' => $orderobject);
* $dest = json_decode('{ "myreference": "abc-123", "customer_id": "{$customer.id}", "order_id": "{$order.id}" }');
*
@RobThree
RobThree / keybase.md
Created May 26, 2015 23:02
keybase.md

Keybase proof

I hereby claim:

  • I am RobThree on github.
  • I am robiii (https://keybase.io/robiii) on keybase.
  • I have a public key whose fingerprint is 8FCA 6E28 8E13 F77A 628D BADA B3F7 16D6 6A0A A857

To claim this, I am signing this object:

@RobThree
RobThree / gitlab-checkandnotify
Last active November 21, 2023 18:00
gitlab version checker & notifier
#!/bin/bash
#mail recipient
RCPT=someone@gmail.com
#args: $rcpt $subject $text
sendnotification() {
echo -e "$3" | mail -s "$2" -t $1
}
echo -n "Checking version: "
@RobThree
RobThree / temps.py
Last active May 30, 2016 00:33
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
#!/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:
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 / tarpit.php
Created December 5, 2016 14:48
PHP Tarpit response
<?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">
@RobThree
RobThree / gist:b7ee02338024beb7a2fbfd14e9a060b2
Last active April 12, 2024 21:31
My AdBlock Plus custom filters
[Adblock Plus 2.0]
! Version:
! Title: RobIII's filters
! Last modified: 2021-7-15
! Expires: 1 hours (update frequency)
! Homepage: https://robiii.me
!
9gag.com###overlay-container
9gag.com###sidebar
9gag.com##.badge-sticky-button
@RobThree
RobThree / check.cs
Last active March 1, 2021 05:29
C# implementation of the FNV-1 and FNV-1a hashes (http://www.isthe.com/chongo/tech/comp/fnv/)
// 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