(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.
/* Polyfill indexOf. */ | |
var indexOf; | |
if (typeof Array.prototype.indexOf === 'function') { | |
indexOf = function (haystack, needle) { | |
return haystack.indexOf(needle); | |
}; | |
} else { | |
indexOf = function (haystack, needle) { | |
var i = 0, length = haystack.length, idx = -1, found = false; |
brew list > brew_list_tmp.txt | |
for each brew_list_tmp.txt do |pkg| | |
brew info pkg | |
get install string from "Built from source with:" | |
add "brew install #{pkg} #{params}" to brew_list.txt | |
end |
(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.
'use strict'; | |
/*****************NATIVE forEACH*********************/ | |
Array.prototype.myEach = function(callback) { | |
for (var i = 0; i < this.length; i++) | |
callback(this[i], i, this); | |
}; | |
//tests |
lsusb
lists the fingerprint reader in the x240 as follows:
Bus 002 Device 003: ID 138a:0017 Validity Sensors, Inc.
There exists experimental driver support for this in a fork of libfprint for vfs5011 sensors, however you'll need to compile the driver yourself. To get the fingerprint sensor to work for lightdm login, su etc, follow these steps.
Install fingerprint-gui:
sudo add-apt-repository ppa:fingerprint/fingerprint-gui
// for browser using, this code requires javascript 1.7+ | |
var arr = [ | |
{ foo: 'bar', lorem: 'ipsum' }, | |
{ foo: 'bar', lorem: 'ipsum' }, | |
{ foo: 'bar', lorem: 'ipsum dolor sit amet' } | |
]; | |
arr = arr.map(JSON.stringify).reverse() // convert to JSON string the array content, then reverse it (to check from end to begining) | |
.filter(function(item, index, arr){ return arr.indexOf(item, index + 1) === -1; }) // check if there is any occurence of the item in whole array |
import React, { Component } from 'react'; | |
import { withRouter } from 'react-router-dom'; // <--- import `withRouter`. We will use this in the bottom of our file. | |
class ContactForm extends Component { | |
submitForm (e) { | |
e.preventDefault() | |
this.props.history.push('/thank-you'); // <--- The page you want to redirect your user to. | |
} |
This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.
Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).