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 / PhonenumberGrabber.cs
Last active December 13, 2015 16:58
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).
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
{
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 November 1, 2013 10:50
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…
public interface IFood
{
bool IsTasty { get; }
}
public class Hamburger : IFood
{
public bool IsTasty { get { return true; } }
}
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 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