curl -4 wttr.in/hamburg
curl ipinfo.iocurl https://ifconfig.me
| import expect from 'expect' | |
| let items = [{price: 19.9}, {price: 59}, {price: 120}, {price: 29.9}] | |
| // the reducer | |
| const add = function add(sum, item) { | |
| return sum + item.price | |
| } | |
| expect(items.reduce(add, 0)).toEqual(228.8) |
| module Module1 | |
| def self.method1 | |
| puts "method1 called" | |
| end | |
| end | |
| class Test | |
| def self.method_missing(name, *args) | |
| if Module1.respond_to?(name) | |
| return Module1.__send__(name, *args) |
| #!/bin/sh | |
| # move this file to /etc/init.d/monit | |
| ### BEGIN INIT INFO | |
| # Provides: monit | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Should-Start: $all | |
| # Should-Stop: $all |
| var request = require("request") | |
| var replaceStream = require('replacestream') | |
| var fs = require('fs') | |
| var path = require('path') | |
| var originCurrency = "EUR" | |
| var originFile = "eu-prices.xml" | |
| var targetCurrency = "NOK" | |
| var rate = 1 |
| var http = require('http'); | |
| http.createServer(function (request, response) { | |
| response.setHeader('Content-Type', 'text/html; charset=UTF-8'); | |
| //response.setHeader('Transfer-Encoding', 'chunked'); | |
| var html = | |
| '<!DOCTYPE html>' + | |
| '<html lang="en">' + | |
| '<head>' + |
| #!/usr/bin/env bash | |
| for folder in $(find * -maxdepth 0 -type d) | |
| do | |
| cat <<EOF > $folder/.project | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <projectDescription> | |
| <name>$folder</name> | |
| <comment></comment> | |
| <projects> |
| #!/bin/bash | |
| set -e | |
| # source: http://jezenthomas.com/using-git-to-manage-todos/ | |
| main() { | |
| while IFS= read -r todo; do | |
| printf "%s\n" "$(file_path):$(line_number) $(line_author) $(message)" | |
| done < <(todo_list) | |
| } |