This guide has been revised 06-03-2015. Start with a clean ubuntu 14.04LTS-x64 machine and get it updated
sudo su
apt-get update && apt-get dist-upgrade
reboot
| partial from http://blog.dimaj.net/content/howto-view-and-analyze-your-logs-web-page | |
| cd ~ | |
| wget https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz | |
| tar xzvf logstash-1.4.2.tar.gz | |
| sudo mv logstash-1.4.2 /opt/logstash | |
| sudo adduser --system --disabled-login --no-create-home --group logstash | |
| sudo usermod -a -G adm logstash | |
| #auto start script for logstash |
| public class MvcApplication : HttpApplication | |
| { | |
| private static void initializeLogging() | |
| { | |
| var loggerConfiguration = new LoggerConfiguration() | |
| .Enrich.WithProperty("type", "application") | |
| .Enrich.WithProperty("application", "my-app-name") | |
| .Enrich.WithProperty("application_version", "1.2.3.4") | |
| .Enrich.WithProperty("environment", "development") | |
| .Enrich.With<Serilog.Extras.Web.Enrichers.HttpRequestIdEnricher>() |
I hereby claim:
To claim this, I am signing this object:
| const assert = require('chai').assert; | |
| /** | |
| * parts of code taken from https://github.com/Reactive-Extensions/RxJS/blob/master/tests/helpers/reactiveassert.js#L32 | |
| * | |
| * and modified to work with the rxjs5 testing shim which has no differentiation between values and predicates | |
| */ | |
| exports.assertEqual = function assertEqual(actual, expected) { | |
| const comparer = require('./is-equal'); // copied and adapted from https://raw.githubusercontent.com/Reactive-Extensions/RxJS/master/src/core/internal/isequal.js | |
| let isOk = true; |
| Rx.Observable.timer(0, 10 * 1000) | |
| .switchMap(_ => fetch('https://blockchain.info/ticker?cors=true') | |
| .then(res => res.json()) | |
| .then(parsed => parsed.EUR.buy) | |
| ) | |
| .distinctUntilChanged() | |
| .scan((acc, curr) => ({ | |
| delta: Math.round((acc.value - curr || 0) * 100) / 100, | |
| value: curr | |
| }), {}) |
Your task is to create an LCD string representation of an integer value using a 3x3 grid of space, underscore, and pipe characters for each digit. Each digit is shown below (using a dot instead of a space)
._. ... ._. ._. ... ._. ._. ._. ._. ._.
|.| ..| ._| ._| |_| |_. |_. ..| |_| |_|
|_| ..| |_. ._| ..| ._| |_| ..| |_| ..|
| /** | |
| * The question may arise whether a positive integer x is a Fibonacci number. This is true if and only if one or both of 5x^{2}+4 or 5x^{2}-4 is a perfect square. | |
| * https://en.wikipedia.org/wiki/Fibonacci_number#Recognizing_Fibonacci_numbers | |
| */ | |
| // the first 20 fibonacci numbers are found 0->6765 | |
| Array.from(generate(6765+1)) | |
| .map((i, idx) => ({number: i, isFibonacci: isFibonacciNumber(i)})) | |
| .filter(kv => kv.isFibonacci) | |
| .map((kv, index) => console.log(`found ${1+index}th fibonacci number: ${kv.number}`)); |
| import 'rxjs/add/observable/empty'; | |
| import 'rxjs/add/operator/do'; | |
| import 'rxjs/add/operator/concat'; | |
| import 'rxjs/add/operator/finally'; | |
| import { Observable } from "rxjs"; | |
| /** | |
| * | |
| * Lifecycle debugging for your stream, sub/unsubscribe,complete and values | |
| * |
| # | |
| # Include this in your own .gitconfig by using the | |
| # [include] directive with the path to this file | |
| # | |
| # [include] | |
| # path = ~/.gitconfig.aliases | |
| # | |
| # If you don't have any existing includes, you can add this via the following command | |
| # | |
| # git config --global include.path ~/.gitconfig.aliases |