This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Rebalancex do | |
alias Rebalancex.Quote | |
@underweight 0.25 | |
@overweight 0.27 | |
def rebalance_portfolio(allocations, quote_service \\ Quote) do | |
portfolio = %{cash: 0, allocations: allocations} | |
prices = get_prices(allocations, quote_service) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
allocations = %{"IAU" => 10, "TLT" => 10, "VGSH" => 10, "VTI" => 10} | |
orders = Rebalancex.rebalance_portfolio(allocations) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
var ws = new WebSocket("ws://localhost:8080/ws/mobile"); | |
function formatMessage(m) { | |
return JSON.stringify(m); | |
} | |
function joinRoom(code) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script> | |
var ws = new WebSocket("ws://localhost:8080/ws/web"); | |
function formatMessage(m) { | |
return JSON.stringify(m); | |
} | |
function roomCreate() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapFunction = function() { | |
emit(this.facebook_object_id, 1); | |
}; | |
var reduceFunction = function(key, values) { | |
return Array.sum(values); | |
}; | |
var options = { | |
query: {published_at: {$gt: new Date(2013, 1, 1)}}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mapFunction = function() { | |
emit(this.facebook_object_id, 1); | |
}; | |
var reduceFunction = function(key, values) { | |
return Array.sum(values); | |
}; | |
var options = { | |
out: {inline: 1}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export LANGUAGE=en_US.UTF-8 | |
export LANG=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
locale-gen en_US.UTF-8 | |
sudo dpkg-reconfigure locales |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var suiteHistory = [{"suiteId":1,"size":120232,"price":324845,"createdAt":1240012800000,"availableAt":null},{"suiteId":1,"size":22250,"price":525868,"createdAt":1247788800000,"availableAt":null},{"suiteId":1,"size":78625,"price":520289,"createdAt":1260230400000,"availableAt":1260230400000},{"suiteId":1,"size":224437,"price":158011,"createdAt":1242000000000,"availableAt":1242000000000},{"suiteId":1,"size":102712,"price":413818,"createdAt":1237852800000,"availableAt":null},{"suiteId":2,"size":192924,"price":306493,"createdAt":1260921600000,"availableAt":null},{"suiteId":2,"size":294399,"price":258054,"createdAt":1256256000000,"availableAt":null},{"suiteId":2,"size":208816,"price":267297,"createdAt":1236211200000,"availableAt":null},{"suiteId":2,"size":261484,"price":499823,"createdAt":1240531200000,"availableAt":null},{"suiteId":2,"size":267668,"price":472518,"createdAt":1252800000000,"availableAt":1252800000000},{"suiteId":3,"size":36096,"price":276294,"createdAt":1240012800000,"availableAt":null},{"suiteId":3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |config| | |
# ... | |
config.expect_with :rspec do |c| | |
c.syntax = :expect | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def all | |
grouped.map do |provider, sources| | |
{name: provider, priority: priority_for(provider), offers: offers(sources)} | |
end.sort_by {|i| i[:priority]}.reject {|i| self.blacklist.include?(i[:name])} | |
end | |
def blacklist | |
if client.version < 2.6 | |
@blacklist ||= [Amazon Maxdome, Google Play, Xbox, Mediamarkt, Videoload, Videobuster] | |
elsif is_landing_page |
NewerOlder