Skip to content

Instantly share code, notes, and snippets.

View cnh's full-sized avatar
💊
lets use ml to fight disease, especially cancer

tp53 cnh

💊
lets use ml to fight disease, especially cancer
View GitHub Profile

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.

def login():
import wx
from send_pass import send_pwd
class AP_App(wx.App):
def OnInit(self):
frame = AP_MainFrame ("Test application", (0, 0), (650, 350))
# frame.Show()
'''
x = 'Writing Fast Tests Against Enterprise Rails 60min \n Overdoing it in python 45min'
print x
y = x.split()
print y
'''
import re
@cnh
cnh / fizzbuzz
Last active December 15, 2015 13:39
numbers = range(1,101)
for i in numbers:
if(i%15 == 0): #divisible by both 3 & 5
print 'FizzBuzz'
elif(i%3 == 0): #divisible by 3
print 'Fizz'
elif (i%5 == 0): #divisible by 5
print 'Buzz'
else:
#!/usr/bin/python
'''
This script requires Python 2.7 or greater,
as it uses the subproces.check_output, which is availablen in Python >= 2.7
It is run using crotab, every 30 minutes, using the following entry in /etc/crontab, on the machine 10.22.5.49
*/30 * * * * gramvaani cd ~/monitoring && ~/.localpython_273/bin/python2.7 gv_heartbeat_v3.py
@cnh
cnh / hack.sh
Created March 31, 2012 21:27 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cnh
cnh / videos.js
Created March 31, 2012 11:22 — forked from christiangenco/videos.js
Download and Organize Coursera videos
$("h3.list_header").each(function(sectionIndex){
var sectionName = $(this).text().replace(/Chapter .+ - /,"").replace(/\:/,'-').replace(/^(V|I|X)+\. /,'');
$(this).parent().next().find("a.lecture-link").each(function(videoIndex){
var $lectureLink = $(this);
var videoName = $.trim($lectureLink.text());
var downloadLink = $lectureLink.attr('href').replace('view','download.mp4');
var cookieHeader = ' --header \"Cookie:'+ document.cookie + '\" ';
var directory = (sectionIndex+1) + '. ' + sectionName + '/';
var filename = directory + (videoIndex+1) + '. ' + videoName + '.mp4';