- click goals
- measures how often visitors click an element
url targeting
| // Base64 encode | |
| val text = "This is plaintext." | |
| val bytesEncoded = java.util.Base64.getEncoder.encode(text.getBytes()) | |
| // Base64 decode | |
| val textDecoded = new String(java.util.Base64.getDecoder.decode(bytesEncoded)) | |
| println(textDecoded) |
| #!/usr/bin/env bash | |
| ENV_PATH="$(dirname "$(dirname "$(which pip)")")" | |
| SYSTEM_VIRTUALENV="$(which -a virtualenv|tail -1)" | |
| BAD_ENV_PATHS="/usr/local" | |
| echo "Ensure the root of the broken virtualenv:" | |
| echo " $ENV_PATH" |
| if (process.argv.length < 3) { | |
| throw `Usage: ${process.argv[1]} path_prefix` | |
| } | |
| const PATH_PREFIX = process.argv[2] | |
| const path = require('path') | |
| const AWS = require('aws-sdk') | |
| const ssm = new AWS.SSM() | |
| function getParametersByPath(nextToken, callback) { |
Have tested these instructions successfully under an Ubuntu 16.04LTS guest with a VirtualBox 5.1 and 5.2 host.
| Object.defineProperty(Number.prototype,Symbol.iterator,{ | |
| *value({ start = 0, step = 1 } = {}) { | |
| var inc = this > 0 ? step : -step; | |
| for (let i = start; Math.abs(i) <= Math.abs(this); i += inc) { | |
| yield i; | |
| } | |
| }, | |
| enumerable: false, | |
| writable: true, | |
| configurable: true |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| def assert_equal(expected, actual) | |
| print expected == actual ? "." : "Expected #{expected.inspect} but got #{actual.inspect}\n" | |
| end | |
| class SummingRule | |
| def initialize(item, price) | |
| @item = item | |
| @price = price | |
| end |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.