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
@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';
@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
#
#!/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 / 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:
'''
x = 'Writing Fast Tests Against Enterprise Rails 60min \n Overdoing it in python 45min'
print x
y = x.split()
print y
'''
import re
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()

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.

@cnh
cnh / tweet_dumper.py
Last active August 29, 2015 14:16 — forked from yanofsky/LICENSE
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
  1. General Background and Overview
@cnh
cnh / drc_v0.py
Last active November 29, 2017 15:30
#import data manipulation modules
import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder
from sklearn.cross_validation import train_test_split
from keras.models import Sequential, load_model #to save , load and persist models
from keras.layers import Activation
from keras.optimizers import SGD