Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is
Ethereum is a trustless network of VMs which run smart contracts submitted by users. It uses proof-of-work to synchronize state across the network, and has every node execute the contracts in order to verify the state's validity. Each transaction is stored in the blockchain for replayability. Read more about it here.
Ethereum's "trustless network" model has some disadvantages:
- Transaction processing is slow - it maxes at roughly 25tx/s right now for all contracts combined.
- Every transaction costs money to execute.
- The entire blockchain state must be shared across the computing network.
- No private transactions.
| import hify from './create-element'; | |
| import React from 'react'; | |
| import { render } from 'react-dom'; | |
| const h = hify(React.createElement.bind(React)); | |
| class Test extends HTMLElement { | |
| static observedAttributes = ['attr'] | |
| attributeChangedCallback (name, oldValue, newValue) { | |
| this.innerHTML = `Hello, ${this.getAttribute('attr')}!`; |
Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.
The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
anyone who has played around with getting performant IO in node will tell you to get really great performance you need to avoid unnecessary memory allocations and memory copying.
Working on pull-file I could get about 1gb/s read on a warm cache, but if I just reused the same buffer over and over I could get 2gb/s!
reusing memory is easy to do in a benchmark, but in an a real system when you read data in order to do something with it. maybe you write it to another file or socket, or maybe you encrypt it? maybe you pass it to a multiplexer which adds framing and then writes that to a socket?
- early example of playful code
// javascript implementationMost of the modules I write are "agnostic" in that they should work in Node, browserify, webpack, Rollup, jspm... hell, even Unreal.js. It's just ES5, CommonJS and a few quirks like process.nextTick or require('path') (which browserify and webpack will shim).
Other modules are a bit trickier, and need to include a static asset like HTML, GLSL or another file.
In Node you might see this:
var fs = require('fs')here are the most useful pull streams modules
a library of simple functions that will be familiar functional programmers.
| export default function renderRoute(request, reply) { | |
| const store = configureStore(); | |
| store.dispatch(match(request.path, (error, redirectLocation, routerState) => { | |
| if (redirectLocation) { | |
| reply.redirect(redirectLocation.pathname + redirectLocation.search); | |
| } else if (error) { | |
| reply(error.message).code(500); | |
| } else if (!routerState) { | |
| reply('Not found').code(404); | |
| } else { |
