Skip to content

Instantly share code, notes, and snippets.

View jamiecollinson's full-sized avatar

Jamie Collinson jamiecollinson

View GitHub Profile
@jamiecollinson
jamiecollinson / main.dart
Created September 16, 2022 15:07
Stateless widget example
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@jamiecollinson
jamiecollinson / timeseries_cnn.py
Created November 22, 2017 13:44 — forked from jkleint/timeseries_cnn.py
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
#!/usr/bin/env python
"""
Example of using Keras to implement a 1D convolutional neural network (CNN) for timeseries prediction.
"""
from __future__ import print_function, division
import numpy as np
from keras.layers import Convolution1D, Dense, MaxPooling1D, Flatten
from keras.models import Sequential
@jamiecollinson
jamiecollinson / gist:0b4955b92f6321c7419dba60246b33e2
Last active February 13, 2017 11:27
Installing React Native Android SDK deps via CLI
android list sdk --all
android update sdk -u -a -t 11,34,74,75,77,164
@jamiecollinson
jamiecollinson / _.md
Last active August 26, 2015 19:04
d3 bubblechart - updateable
@jamiecollinson
jamiecollinson / _.md
Last active August 29, 2015 14:28
d3 bubblechart
@jamiecollinson
jamiecollinson / install.sh
Last active November 24, 2017 04:02
Installing OpenVBX on Ubuntu 14.04 EC2 instance
# check for updates
sudo apt-get update
sudo apt-get upgrade
# install necessary software
sudo apt-get install mysql-server apache2 php5 libapache2-mod-php5 php5-mysql libapache2-mod-auth-mysql php5-curl git sendmail
# create DB
echo "CREATE DATABASE OpenVBX; GRANT ALL PRIVILEGES ON OpenVBX.* TO ubuntu@localhost IDENTIFIED BY {PASSWORD_HERE}; FLUSH PRIVILEGES" | sudo mysql -p

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.

// create a one-time event
function onetime(node, type, callback) {
// create event
node.addEventListener(type, function(e) {
// remove event
e.target.removeEventListener(e.type, arguments.callee);
// call handler
return callback(e);
});