There are two ways to work with Either in Scala.
If you want to update only one side use a projection and map
response.right.map(_.parseJson.convertTo[Seq[String]])
mkdir $HOME/gopath
export GOPATH="$HOME/gopath"
export PATH="$GOPATH/bin:$PATH"
require 'sinatra' | |
require 'mongo' | |
require 'json/ext' | |
include Mongo | |
def connect! | |
begin | |
MongoClient.new("localhost", 27017) | |
rescue |
// |
var ChannelView = Backbone.View.extend({ | |
initialize: function() { | |
this.channel = new Channel({id: this.id}); | |
this.channel.events.fetch().done(_.bind(function(){ | |
this.render(); | |
}, this)); | |
}, | |
render: function() { | |
this.channel.events.forEach(function(e) { |
App.prototype = { | |
poll: function(endpoint){ | |
$.ajax({ url: endpoint, success: function(data){ | |
console.log(data); | |
}, dataType: "json", complete: _.bind(function() { | |
setTimeout(_.bind(function() { | |
this.poll(endpoint) | |
}, this), this.pollingFrequency); | |
}, this), timeout: 3000 }); | |
} |
module Data.Set.Unboxed ( | |
-- * Set type | |
USet -- instance Eq,Ord,Show,Read,Data,Typeable | |
, US | |
, Boxed(Boxed) | |
-- * Operators | |
, (\\) | |
-- * Query |
(* ========================================================================= *) | |
(* Misc library functions to set up a nice environment. *) | |
(* ========================================================================= *) | |
let identity x = x;; | |
let ( ** ) = fun f g x -> f(g x);; | |
(* ------------------------------------------------------------------------- *) | |
(* GCD and LCM on arbitrary-precision numbers. *) |
function fisherYates(array) { | |
for (var i = array.length - 1; i > 0; i--) { | |
var j = Math.floor(Math.random() * (i + 1)); | |
var temp = array[i]; | |
array[i] = array[j]; | |
array[j] = temp; | |
} | |
return array; | |
} |
# Setup our folder structure | |
cd /var | |
sudo mkdir -p fshionable | |
sudo mkdir -p fshionable/site.git | |
cd /var/fshionable/site.git | |
# Create a bare git repo to receive our push | |
git init --bare |