Skip to content

Instantly share code, notes, and snippets.

🤙
Being awesome

Rob Janssen RobThree

🤙
Being awesome
View GitHub Profile
View 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.

View WordTableExtractor.cs
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
Class used to merge objects based on a specific syntax specified as strings
View ObjectMerger.php
<?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}" }');
*
View 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 / PhonenumberGrabber.cs
Last active Dec 13, 2015
Tries to grab phonenumbers from an active control (selected text) in an active window. Uses a TextSelectionReader internally (see https://gist.github.com/RobThree/4943725).
View PhonenumberGrabber.cs
using System;
using System.Linq;
using System.Text.RegularExpressions;
/// <summary>
/// Tries to grab phonenumbers from an active control (selected text) in an active window. Uses
/// a <see cref="TextSelectionReader"/> internally.
/// </summary>
public class PhonenumberGrabber
{
@RobThree
RobThree / linqhelpers.cs
Last active Dec 21, 2015
Linq extensions: Diff, ToChunks and ExecuteChunked
View linqhelpers.cs
using System;
using System.Linq;
using System.Collections.Generic;
//Sample program demonstrating the linq extensions (below Progam class)
class Program
{
static void Main(string[] args)
{
//Demonstrate Diff
View whitespacewatermarker.cs
using System;
using System.Linq;
using System.Text;
//Demonstrate usage
class Program
{
static void Main(string[] args)
{
var ww = new WhitespaceWatermarker();
@RobThree
RobThree / exampleclassesandinterfaces.cs
Created Nov 1, 2013
An improvement upon http://stackoverflow.com/a/4100126/215042. This factory can be used as a generic factory. Improvements are, amongst others: • Generics • Being able to specify case(in)senstivity when resolving instances • Constructor overloads; the default will assume the Executing Assembly, other assemblies can be passed using an overload of…
View exampleclassesandinterfaces.cs
public interface IFood
{
bool IsTasty { get; }
}
public class Hamburger : IFood
{
public bool IsTasty { get { return true; } }
}
View duplicatefinder.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
class Program
{
static void Main(string[] args)
{
var duplicates = new DirectoryInfo(@"G:\sampling")
@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.