Method | Side effects1 | State updates2 | Example uses |
---|---|---|---|
Mounting | |||
componentWillMount |
✓ | Constructor equivalent for createClass |
|
render |
Create and return element(s) | ||
componentDidMount |
✓ | ✓ | DOM manipulations, network requests, etc. |
Updating | |||
componentWillReceiveProps |
✓ | Update state based on changed props |
This file contains 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
""" pipelines.py """ | |
import collections | |
import scrapy | |
import scrapy.contrib.exporter | |
import myproject | |
class SitemapPipeline(object): | |
""" | |
Sitemap builder |
This file contains 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
$ brew install irssi gmp | |
$ cpan install Crypt::OpenSSL::Bignum Crypt::Blowfish Crypt::DH::GMP | |
$ echo '[[ $SHLVL -eq 1 ]] && eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >> ~/.bashrc | |
$ mkdir -p ~/.irssi/scripts/autorun | |
$ (cd ~/.irssi/scripts/; wget https://freenode.net/sasl/cap_sasl.pl; ln -s ../cap_sasl.pl autorun/) | |
$ irssi | |
/sasl set <network> <nick> <password> DH-BLOWFISH | |
/sasl save |
This file contains 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
# Default terminal | |
set-option -g default-terminal "screen-256color" | |
# Use vim key bindings | |
set-option -g mode-keys vi | |
set-option -g status-keys vi | |
# Turn the mouse on | |
set-option -g mouse on |
This file contains 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
const http2 = require('http2'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const zlib = require('zlib'); | |
const brotli = require('brotli'); // npm package | |
const PORT = 3032; | |
const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
const cache = {}; |
Recently, news broke about a new possible offline attack on WPA2 using PMKID. To summarize the attack, WPA2 protected APs can end up broadcasting PMKID values which can then be used to offline-brute-force the password.
These PMKID values are computed this way:
PMKID = HMAC-SHA1-128(PMK, "PMK Name" | MAC_AP | MAC_STA)
This file contains 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
#!/bin/bash | |
if [ -z "$1" ] | |
then | |
echo "Please specify a folder" | |
exit | |
fi | |
if [ -z "$2" ] | |
then |
- Close Android File Transfer
- Open Activity Monitor and kill “Android File Transfer Agent”
- Go to where you installed “Android File Transfer.app” (I have it under /Applications)
- Ctrl+click –> “Show package contents”
- Go to Contents/Resources
- Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
- Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
We will compare ASP.NET and Node.js for backend programming.
Source codes from examples.
This document was published on 21.09.2015 for a freelance employer. Some changes since then (14.02.2016):
- Koa.js no longer uses co-routines, it has switched to Babel's
async/await
.yield
andawait
are used almost in the same way, so I see no point to rewrite the examples.
OlderNewer