This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.
$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
| # call this server using the following js command from the browser console: | |
| # (await fetch('http://localhost:5000/', {method: "POST", body: '5'})).text() | |
| # note: wsgiref is only good for development and in that case Werkzeug is | |
| # usually preferred. See http://mitsuhiko.pocoo.org/wzdoc/wsgihowto.html | |
| from wsgiref.simple_server import make_server | |
| from flask import Flask, request, Response | |
| app = Flask(__name__) |
| groups: | |
| - name: datetime | |
| rules: | |
| - record: daily_saving_time_belgium | |
| expr: | | |
| (vector(0) and (month() < 3 or month() > 10)) | |
| or | |
| (vector(1) and (month() > 3 and month() < 10)) | |
| or | |
| ( |
| #!/usr/bin/env python2 | |
| # A script to generate a report of Elasticsearch index usage | |
| # (from _cat/indices?v&bytes=b) by prefix for a set of known | |
| # date suffixes. | |
| # | |
| # E.g. | |
| # $ curl -X GET http://localhost:9200/_cat/indices?v\&bytes=b -o indices.lis | |
| # $ ./sum-es-indices.py indices.lis | |
| # |
| // read the response body to a variable | |
| bodyBytes, _ := ioutil.ReadAll(response.Body) | |
| // Use io.Copy to just dump the response body to the file. This supports huge files | |
| err := ioutil.WriteFile("tmp/asdf.png", bodyBytes, 0644) | |
| if err != nil { | |
| log.Fatal(err) | |
| } | |
| fmt.Println("Captcha image saving success!") | |
| //reset the response body to the original unread state | |
| response.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) |
| @echo off | |
| echo Stdout | |
| echo Stderr 1>&2 |
| SELECT table, | |
| formatReadableSize(sum(bytes)) as size, | |
| min(min_date) as min_date, | |
| max(max_date) as max_date | |
| FROM system.parts | |
| WHERE active | |
| GROUP BY table |
| package main | |
| import ( | |
| "encoding/json" | |
| "net/http" | |
| consul "github.com/hashicorp/consul/api" | |
| ) | |
| func getKVdata() *consul.KVPair { |
| func main() { | |
| ctx := context.Background() | |
| // trap Ctrl+C and call cancel on the context | |
| ctx, cancel := context.WithCancel(ctx) | |
| c := make(chan os.Signal, 1) | |
| signal.Notify(c, os.Interrupt) | |
| defer func() { | |
| signal.Stop(c) |
| package Village | |
| type Acceptor struct { | |
| Name string | |
| preferences map[*Proposer]int | |
| Free bool | |
| partner *Proposer | |
| proposalPool []*Proposer | |
| } |