This is a simple proof-of-concept example of how one could embed Juttle-powered charts and visualizations in a custom application.
Requires node.js to be installed.
address constant public amb_mediator = 0x5275e7264AB0Bb75D970E7442De0Aadd0C0b85ae; | |
function depositAndBridge() external override payable returns (bool success) { | |
require(address(this).balance + flashSupply <= type(uint112).max, "WETH::deposit: supply limit exceeded"); | |
// Create token balance for deposit | |
balanceOf[msg.sender] += msg.value; | |
// Approve the new tokens to the mediator contract | |
allowance[msg.sender][amb_mediator] = msg.value; |
1) go to https://ropsten.etherscan.io/verifyContract?a=0xa32b21ba14fd476757e392db5d1bbc833eaedaf5 | |
2) enter contract address, name, compiler | |
3) copy code of contract flatten out (delete import and replace by actual code) | |
4) truffle console | |
5) var Eth = require('ethjs') | |
6) Eth.abi.encodeParams(["uint256", "uint256", "uint256", "address", "uint256"], ["1508105298", "1508710098", "200", "0x3d208fabaf7e919985d5d2f068f28d6a9022e8d5", "5000000000000000000000000000"]) | |
7) copy paste result of encodeParams without '0x' |
pragma solidity ^0.4.0; | |
contract Token { | |
function transfer(address to, uint256 value) returns (bool); | |
function transferFrom(address from, address to, uint256 value) returns (bool); | |
} | |
/// @title State Channel contract - Allows multiple parties to settle off-chain transactions. | |
/// @author Stefan George - <[email protected]> | |
contract StateChannelProxy { |
var https = require('https'); | |
exports.handler = function(event, context) { | |
var appkey = 'YOUR_REALTIME_APPKEY'; | |
var privatekey = 'YOUR_REALTIME_PRIVATEKEY'; | |
var channel = 'aws-iot'; | |
var message = JSON.stringify(event); | |
var postBody = "AK=" + appkey + "&PK=" + privatekey + "&C=" + channel + "&M=" + message; | |
var headers = { |
var WebSocket = require('ws'); | |
var userPublicToken = 'apikey'; | |
var username = 'username'; | |
var ws = new WebSocket('wss://stream.tutum.co/v1/events?token='+ userPublicToken +'&user=' +username); | |
ws.on('open', function() { | |
console.log('Connected'); | |
}); |
After publishing my article on ECMAScript 6, some have reached out to ask how I exactly I make it all work.
I refrained from including these details on the original post because they're subject to immiment obsoletion. These tools are changing and evolving quickly, and some of these instructions are likely to become outdated in the coming months or even weeks.
When evaluating the available transpilers, I decided to use 6to5, which has recently been renamed to Babel. I chose it based on:
This post described how to create an application with mithril 0.2.x. Now that ver 1.0 is out, some things are a little differnent.
The example is updated with the current version of mithril, though.
(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.
Many of the technologies being built today are based on the ideas initially conceived by post-World War II scientists. In fact, it was in July of 1945, when Dr. Vannevar Bush described the ["memex" device][2], a device with an uncanny resemblance to the Internet:
A memex is a device in which an individual stores all his books, records, and communications, and which is mechanized so that it may be consulted with exceeding speed and flexibility.
Only twenty years later in 1965, Ted Nelson, inspired by the same Dr. Bush, would conceive of the idea that content and documents should be ["hyperlinked"][3]. And finally in 1990, [Tim Berners-Lee along with some of his colleagues][4], would tie the concept of the hyperlink together with the idea of an inter-connected world to develop what we know now today as the Internet, allowing humankind to access and link information across vast distances almost instantly.