(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
package auth | |
import ( | |
"crypto/rsa" | |
"encoding/base64" | |
"encoding/binary" | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"log" |
import * as rx from 'rxjs'; | |
import * as fs from 'fs'; | |
import * as path from 'path'; | |
function cp(from: string, to: string) { | |
return stat(from) | |
.flatMap((s) => { | |
return s.isDirectory() ? copyDir(from, to) : copyFile(from, to) | |
}) | |
} |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
using System; | |
using System.Linq; | |
using Ninject; | |
using Ninject.Extensions.Factory; | |
namespace SomeRootNamespace | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
// EntryPoint.js | |
define(function () { | |
return function EntryPoint(model1, model2) { | |
// stuff | |
}; | |
}); | |
// Model1.js | |
define(function () { | |
return function Model1() { |
function get_avatar_from_service(service, userid, size) { | |
// this return the url that redirects to the according user image/avatar/profile picture | |
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback | |
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px ) | |
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word ) | |
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px ) | |
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word ) | |
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px ) | |
// everything else will go to the fallback | |
// google and gravatar scale the avatar to any site, others will guided to the next best version |