Saturday, July 21, 2018

LinkedIn Rolls Out New Posting Tools

Welcome to this week’s edition of the Social Media Marketing Talk Show, a news show for marketers who want to stay on the leading edge of social media. On this week’s Social Media Marketing Talk Show, we explore new LinkedIn posting tools, new Instagram features being tested, new Facebook Ad Manager app creative tools, and [...]

The post LinkedIn Rolls Out New Posting Tools appeared first on Social Media Examiner.


by Grace Duffy via Social Media Examiner

The New Status Dots On Instagram Will Tell If Someone Is Online

Earlier this year, Instagram began indicating when your friends went online last. Building on this technique, the company is applying it to the status indicators which will tell you about if that particular is online or not. When you go to the direct messaging section next time, you'll appreciate...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Mehwish Mehmood via Digital Information World

Dot Lung

Dot Lung – Mother of Social Media Dragons
by via Awwwards - Sites of the day

Friday, July 20, 2018

Top 10 E-Commerce Platforms by Usage in 2018 (infographic)

E-commerce is a fast growing industry. With its revenues already in trillions, it is projected to grow even bigger in the upcoming years. This makes it a very suitable business to invest in; but, before beginning, an outlook of different E-commerce platforms is necessary, so as to understand which...

[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Neha Zaidi via Digital Information World

The Future of WebAssembly

#395 — July 20, 2018

Read on the Web

JavaScript Weekly

TOAST UI Grid 3.0: A Powerful Data Grid Control — Another great piece of work from NHN who also produced an image editor we linked last week. This data grid component works down to IE8, with many data types, and is easily rethemed.

NHN Entertainment

JavaScript Fundamentals Before Learning React — A concise list of all the different JavaScript functionalities that can be used to complement a React app.

Robin Wieruch

Try DigitalOcean and Get a $100 Credit on Us — Save up to 55% compared to other cloud providers and start building, deploying and scaling better web apps.

DigitalOcean sponsor

A Great Explanation of JavaScript Reactivity — Understand what ‘reactivity’ is and how it works by way of implementing your own system that’s similar to Vue’s approach. There’s also a 15 minute video version, if you prefer.

Gregg Pollack

v8n: A JavaScript Fluent Validation Library — If you like ‘fluent’, chainable APIs, you might like this approach to object validation, e.g. v8n().number().between(0, 100).test(44) .. though it goes a lot further than that.

Bruno C. Couto

The Future of WebAssembly: A Look At Upcoming Features and Proposals — WebAssembly is a binary instruction format that runs at high performance in all major browsers. It’s still relatively new though and a work in progress. This post looks at WebAssembly’s roadmap and the features it could gain in the near future.

Colin Eberhardt

Two-Factor Authentication Protection for npm Packages in Beta — As a follow up to the eslint-scope npm problem we covered last week, you can now test two-factor authentication protection for individual packages in the npm Registry.

The npm Blog

💻 Jobs

Sr. Front-End Engineer, OTT - New York City — Vimeo is a place where all stories can be beautifully told. Build the future with us.

Vimeo

Senior/Lead JavaScript Developer (Boston or Oakland) — Do more than code - influence development practices and product direction. Work with enthusiastic peers in a trust-based environment.

Raizlabs, a Rightpoint Company

Find A JavaScript Job Through Vettery — Vettery specializes in tech roles and is completely free for job seekers. Create your profile to get started.

Vettery

📘 Tutorials and Opinions

Building a Serverless Contact Form with AWS Lambda and AWS SES — Covers the basics of both the front-end form, with vanilla JavaScript, and the serverless back end, hosted on AWS Lambda.

Adnan Rahić

Build an Instagram Clone with Vue.js and CSSGramCSSGram recreates Instagram-style filters using CSS filters and blend modes.

Hassan Djirdeh

How to Do Functional Programming with JavaScript? — A handy cheat sheet used by JavaScript developers interested in writing functional style code. Check it out.

Progress Kendo UI sponsor

Designing GraphQL APIs — A tutorial built at Shopify (initially for internal use) based on lessons learnt creating and scaling schemas on GraphQL APIs at Shopify.

Shopify Engineering

▶  Native JavaScript Modules — A look at how native JS modules work, what the current level of support is for them, plus main findings and gotchas from using them in production.

Serg Hospodarets

15 HTML Element Methods You’ve Potentially Never Heard of — The DOM is full of delights, some of which David pokes at here, including scrollIntoView, getBoundingClientRect, and select.

David Gilbertson

How to Build a Microsoft Excel Add-in with Vue — Did you know you can build add-ins for Excel with JavaScript?

Microsoft

Build a Netflix Style Video Delivery Platform — View videos at the same quality & speed as Netflix & YouTube. API clients for all major languages.

Bitmovin sponsor

Recreating Reddit’s Voting UI in Vanilla JS vs React vs Vue vs Hyperapp — A comparison hoping to ‘shed light’ on the purpose of using frameworks.

atomiks

▶  Pushing the Limits of the Web with Angular — Showing off some of the newest capabilities of Angular.

Stephen Fluin

How Fast Can You Learn React?”..learning React is about as easy as teaching a parrot to talk”. — Oh, and if you are starting to explore React, we have a newsletter for that ;-).

Attila Vágó

🔧 Code and Tools

Pushbar.js: Simply Creating 'Sliding Drawers' on Your Pages/Apps

Biraj Ghosh

Popbox.js: Stackable Modals for Web Pages — If you need a modal on top of your modal..

popbox.js

localForage: Offline Storage, Improved — Wraps IndexedDB, WebSQL, or localStorage using a simple API.

localForage

Polly.js: Record, Replay, and Stub HTTP Interactions — Polly taps into native browser APIs to mock requests and responses.

Netflix, Inc.

Save Weeks Per Year Fixing Unseen Bugs Using Source Maps with Sentry

Sentry sponsor

Jest Watch Toggle Config Plugin: Toggle Your Jest Boolean Config Settings At Will

Jest Community

CanJS 5.0 Released: A Framework for Building Rich Web Interfaces

Justin Meyer

Z: Pattern Matching for JavaScript

Wagner Leonardi et al.

Hypernova: A Service for Server-Side Rendering of JS Views

Airbnb

How to Dynamically Load JS Modules on Codepen

CodePen


by via JavaScript Weekly

Yo! #022

 

This week in Yo! I cover variable fonts, scrolling gradients, a font memory game, gradient backgrounds, where CSS4 is, beats, laughs and more.

Yo! is my weekly YouTube show covering the latest design and development news. Each story mentioned is also blogged on the Yo! website but if you want them emailed to you each week, simply join the dedicated Yo! newsletter💌


by Rob Hope @robhope via One Page Love

Building Ethereum DApps: Voting with Custom Tokens

In part 5 of this tutorial series on building DApps with Ethereum, we dealt with adding content to the story, looking at how to add the ability for participants to buy tokens from the DAO and to add submissions into the story. It’s now time for the DAO’s final form: voting, blacklisting/unblacklisting, and dividend distribution and withdrawal. We’ll throw in some additional helper functions for good measure.

If you get lost in all this, the full source code is available in the the repo.

Votes and Proposals

We’ll be issuing Proposals and voting with Votes. We need two new structs:

struct Proposal {
    string description;
    bool executed;
    int256 currentResult;
    uint8 typeFlag; // 1 = delete
    bytes32 target; // ID of the proposal target. I.e. flag 1, target XXXXXX (hash) means proposal to delete submissions[hash]
    uint256 creationDate;
    uint256 deadline;
    mapping (address => bool) voters;
    Vote[] votes;
    address submitter;
}

Proposal[] public proposals;
uint256 proposalCount = 0;
event ProposalAdded(uint256 id, uint8 typeFlag, bytes32 hash, string description, address submitter);
event ProposalExecuted(uint256 id);
event Voted(address voter, bool vote, uint256 power, string justification);

struct Vote {
    bool inSupport;
    address voter;
    string justification;
    uint256 power;
}

A Proposal will have a mapping of voters to prevent people from voting on a proposal twice, and some other metadata which should be self-explanatory. The Vote will either be a yes or no vote, and will remember the voter along with their justification for voting a certain way, and the voting power — the number of tokens they want to devote to voting for this proposal. We also added an array of Proposals so we can store them somewhere, and a counter for counting how many proposals there are.

Let’s build their accompanying functions now, starting with the voting function:

modifier tokenHoldersOnly() {
    require(token.balanceOf(msg.sender) >= 10**token.decimals());
    _;
}

function vote(uint256 _proposalId, bool _vote, string _description, uint256 _votePower) tokenHoldersOnly public returns (int256) {

    require(_votePower > 0, "At least some power must be given to the vote.");
    require(uint256(_votePower) <= token.balanceOf(msg.sender), "Voter must have enough tokens to cover the power cost.");

    Proposal storage p = proposals[_proposalId];

    require(p.executed == false, "Proposal must not have been executed already.");
    require(p.deadline > now, "Proposal must not have expired.");
    require(p.voters[msg.sender] == false, "User must not have already voted.");

    uint256 voteid = p.votes.length++;
    Vote storage pvote = p.votes[voteid];
    pvote.inSupport = _vote;
    pvote.justification = _description;
    pvote.voter = msg.sender;
    pvote.power = _votePower;

    p.voters[msg.sender] = true;

    p.currentResult = (_vote) ? p.currentResult + int256(_votePower) : p.currentResult - int256(_votePower);
    token.increaseLockedAmount(msg.sender, _votePower);

    emit Voted(msg.sender, _vote, _votePower, _description);
    return p.currentResult;
}

Notice the function modifier: by adding that modifier into our contract, we can attach it to any future function and make sure only token holders can execute that function. It’s a reusable security check!

The vote function does some sanity checks like the voting power being positive, the voter having enough tokens to actually vote etc. Then we fetch the proposal from storage and make sure it’s neither expired nor already executed. It wouldn’t make sense to vote on a proposal that’s already done. We also need to make sure this person hasn’t yet voted. We could allow changing the vote power, but this opens the DAO to some vulnerabilities like people withdrawing their votes at the last minute etc. Perhaps a candidate for a future version?

Then we register a new Vote into the proposal, change the current result for easy lookup of scores, and finally emit the Voted event. But what’s token.increaseLockedAmount?

This bit of logic increases the amount of locked tokens for a user. The function is only executable by the owner of the token contract (by this point that’s hopefully the DAO) and will prevent the user from sending an amount of tokens that exceeds the locked amount registered to their account. This lock is lifted after the proposal falls through or executes.

Let’s write the functions for proposing the deletion of an entry now.

The post Building Ethereum DApps: Voting with Custom Tokens appeared first on SitePoint.


by Bruno Skvorc via SitePoint