I started using React 3.5 years ago, and I still love it. It was such a well-designed solution that not much has changed since then, only superficial stuff like naming. What I learned then is still wholly applicable today because it's such a good idea (although now you can choose from many other libraries). On top of that, we now benefit from an entirely new architecture (fiber) without changing much.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Facebook DOM Traversal</title> | |
</head> | |
<body> | |
<div id="rootA"> | |
<div> |
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
// Option C: | |
// this implementation has a small amount of overhead compared to (a) and (b) | |
const React = require('react'); | |
const counterState = React.createStateReducer({ | |
initialState: props => ({ | |
counter: 0, | |
divRef: React.createRef(), | |
}), | |
reducer: (action, state) => { |
This guide shows how to set up a bidirectional client/server authentication for plain TLS sockets.
Newer versions of openssl are stricter about certificate purposes. Use extensions accordingly.
Generate a Certificate Authority:
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
function twr(transactions, roundingFactor, emv) | |
{ | |
// beginning market value | |
var bmv = 0; | |
// Sort by date | |
transactions.sort(function(a, b){ | |
var da = new Date(a.date); | |
var db = new Date(b.date); |
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
import React from 'react' | |
import FormValidate, { ErrorComponent, identity, ruleValidate, validator } from '../Form_HOC' | |
import { mount } from 'enzyme' | |
import { withHandlers } from 'recompose' | |
import { Stateful } from 'react-mock' | |
describe('FormValidate', () => { | |
let Form | |
let wrapper | |
let stateful |
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
ffmpeg -i data/video.mp4 -vcodec h264 -b:v 1000k -acodec mp2 data/output.mp4 |
To get syntax highlighting for ESNext (including JSX), you need to have pygments-lexer-babylon
installed:
pip install pygments pygments-lexer-babylon
Now when you run pygmentize
on a .jsx
file it'll automatically use the new lexer! 🎉
###Sketch trial non stop
Open hosts files:
$ open /private/etc/hosts
Edit the file adding:
127.0.0.1 backend.bohemiancoding.com
127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com
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
/* eslint-disable no-sync */ | |
const request = require('superagent') | |
const path = require('path') | |
const fs = require('fs') | |
const ACCOUNT = 'account' | |
const PROJECT = 'project-name' | |
const TOKEN = 'your-token' | |
const ASSET_URL = 'https://example.com/assets' | |
const SOURCEMAPS_PATH = './temp' |
NewerOlder