current task:
todo:
- [] <> . ?/?
- the two is the previst pomodoro, and the interrogation is the spend pomodoros. 2/?
- The first todo is to copy. 2/?
- [] lorem. 2/?
#!/bin/bash | |
readonly PROGNAME=$(basename $0) | |
default_since="10s" | |
default_namespace="default" | |
default_line_buffered="" | |
default_colored_output="pod" | |
line_buffered="${default_line_buffered}" |
// TL;DR | |
// return arrays | |
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all | |
// http://stackoverflow.com/questions/28250680/how-do-i-access-previous-promise-results-in-a-then-chain | |
// http://stackoverflow.com/questions/22892681/what-patterns-are-there-for-passing-state-through-a-chain-of-promises-in-javascr | |
// http://bluebirdjs.com/docs/api/spread.html | |
// You design your api like aways, put when you want to pass a value, you pass Promise.all, and you do this in | |
// process of chaining it, your api, doesn't need to be awere of promises |
-- This that the function toInt takes a String and returns a Integer | |
toInt :: String -> Int | |
-- This means that the function run takes 'a' and returns a 'b' | |
run :: a -> b | |
-- https://www.fpcomplete.com/blog/2012/09/ten-things-you-should-know-about-haskell-syntax | |
-- http://stackoverflow.com/questions/5926826/what-does-double-colon-stand-for-in-haskell |
# https://medium.com/@joewalnes/tail-f-to-the-web-browser-b933d9056cc#.nzwlj0wp6 | |
# Server | |
$ (echo -e ‘HTTP/1.1 200 OK\nAccess-Control-Allow-Origin: *\nContent-type: text/event-stream\n’ && tail -f /path/to/some/file | sed -u -e ‘s/^/data: /;s/$/\n/’) | nc -l 1234 | |
# Browser | |
new EventSource("http://host:1234/").onmessage = function(e) { | |
console.log(e.data); | |
}; |
cd /tmp | |
repo="ginatrapani/todo.txt-cli" | |
url=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | sed -n -e '/"browser_download_url":/ s/^.*"\(.*\)".*/\1/p' | grep tar.gz) | |
wget $url -O latest.tar.gz | |
mkdir -p /usr/local/src/todo-txt | |
tar -xvzf latest.tar.gz -C /usr/local/src/todo-txt --strip-components 1 | |
rm latest.tar.gz | |
cd /usr/local/src/todo-txt && find . -iname \*.sh | xargs chmod +x | |
cp /usr/local/src/todo-txt/*.sh /usr/local/bin/ | |
mkdir -p "$TODO_ACTIONS_DIR" |
# https://github.com/containership/alpine-node-yarn/blob/master/Dockerfile | |
FROM node:alpine | |
# Add yarn to env | |
# Ember-cli need this TEMP https://github.com/stefanpenner/async-disk-cache/issues/31 | |
ENV PATH /root/.yarn/bin:$PATH | |
ENV TMPDIR /tmp | |
# | |
RUN apk update && apk upgrade && \ |
apiVersion: v1 | |
data: | |
proxy.conf: | | |
## Nginx Production Https Ember Server Configuration | |
## http redirects to https ## | |
server { | |
listen 443 ssl default deferred; | |
# @todo Check if the `server_name` is necessary |
version: '2' | |
services: | |
web: | |
image: yurifl/node | |
command: npm run dev | |
working_dir: /app | |
ports: | |
- 8080:8080 | |
- 9876:9876 | |
volumes: |
// taken from http://blog.mgechev.com/2013/01/21/functional-programming-with-javascript/ | |
const $ = fun.parameter | |
const fact = fun( | |
[0, function () { return 1; }], | |
[$, function (n) { return n * fact(n - 1); }] | |
) |