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
[1/1 TypesDoNotUnify] src/Main.purs:20:16 | |
v | |
20 config state = do | |
21 -- | Create a signal of URL changes. | |
22 urlSignal <- sampleUrl | |
... | |
29 , update: update | |
30 , view: view | |
31 , inputs: [routeSignal] } |
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
boot.kernelPackages = pkgs.linuxPackags_4_2; | |
boot.initrd.luks.devices = [ | |
{ name = "rootfs"; | |
device = "/dev/sda3"; | |
preLVM = true; } | |
]; | |
networking.hostName = "sn-m3800-nixos"; | |
networking.networkmanager.enable = true; | |
i18n = { |
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
module Main where | |
import Prelude | |
import Data.Maybe | |
import Data.Array | |
import Data.Either | |
import Data.Foreign | |
import Node.Yargs |
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
identity = (x) -> x |
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 endpoint = 'my/endpoint' | |
var dataPromise = getData(endpoint) | |
console.log(1) | |
dataPromise.then(function(data) { | |
console.log(2) | |
}) | |
console.log(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
var endpoint = 'my/endpoint' | |
console.log(1) | |
getData(endpoint, function(err, data) { | |
console.log(2) | |
}) | |
console.log(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
var endpoint = 'my/endpoint' | |
console.log(1) | |
getData(endpoint, function(err, data) { | |
console.log(2) | |
}) | |
console.log(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
// Part 2 | |
var username = 'seanghagstrom' | |
findLikesForPostsByUsername(username) | |
.then(function(totalLikes) { | |
console.log(username + ' total number of likes: ' + totalLikes) | |
}) | |
.catch(function(err) { | |
console.error(err) |
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
// Part 1 | |
function findLikesForPostsByUsername(username, callback) { | |
var promise = new Promise(function(resolver, rejector) { | |
findUserByUsername(username) | |
.then(findPostsByUser) | |
.then(findLikesByPosts) | |
.then(function(likes) { | |
var totalLikes = likes.reduce(function(x, y) { return x + y }) | |
resolver(totalLikes) |
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 endpoint = 'my/endpoint' | |
var dataPromise = getData(endpoint) | |
dataPromise.then(function(data) { | |
console.log(data) | |
}, function(error) { | |
console.error(error) | |
}) |