(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.
| #!/usr/bin/env python | |
| # Ported to Python from http://www.vim.org/scripts/script.php?script_id=1349 | |
| print("Color indexes should be drawn in bold text of the same color.") | |
| print() | |
| colored = [0] + [0x5f + 40 * n for n in range(0, 5)] | |
| colored_palette = [ | |
| "%02x/%02x/%02x" % (r, g, b) | |
| for r in colored |
| /* | |
| I've wrapped Makoto Matsumoto and Takuji Nishimura's code in a namespace | |
| so it's better encapsulated. Now you can have multiple random number generators | |
| and they won't stomp all over eachother's state. | |
| If you want to use this as a substitute for Math.random(), use the random() | |
| method like so: | |
| var m = new MersenneTwister(); |
(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.
| # ANSI Start Codes | |
| # Styles. | |
| Normal="\x1b[0m" | |
| Bold="\x1b[1m" | |
| Faint="\x1b[2m" | |
| Italic="\x1b[3m" | |
| Underline="\x1b[4m" | |
| Blink_Slow="\x1b[5m" | |
| Blink_Rapid="\x1b[6m" |
| var crypto = require('crypto'); | |
| // larger numbers mean better security, less | |
| var config = { | |
| // size of the generated hash | |
| hashBytes: 32, | |
| // larger salt means hashed passwords are more resistant to rainbow table, but | |
| // you get diminishing returns pretty fast | |
| saltBytes: 16, | |
| // more iterations means an attacker has to take longer to brute force an |
| server: | |
| ########################################################################### | |
| # BASIC SETTINGS | |
| ########################################################################### | |
| # Time to live maximum for RRsets and messages in the cache. If the maximum | |
| # kicks in, responses to clients still get decrementing TTLs based on the | |
| # original (larger) values. When the internal TTL expires, the cache item | |
| # has expired. Can be set lower to force the resolver to query for data | |
| # often, and not trust (very large) TTL values. | |
| cache-max-ttl: 86400 |
| server: | |
| interface: 0.0.0.0 | |
| interface: ::0 | |
| access-control: 192.168.42.0/24 allow | |
| access-control: 127.0.0.0 allow | |
| access-control: 2001:db8:dead:beef::/48 allow | |
| # unbound optimisation | |
| num-threads: 4 |