Skip to content

Instantly share code, notes, and snippets.

View eff-kay's full-sized avatar
😀

faizan khan eff-kay

😀
View GitHub Profile
@eff-kay
eff-kay / 2020.08-D.Quah-Pandoc-Workflow-Markdown-PDF.md
Created October 17, 2024 06:58 — forked from DannyQuah/2020.08-D.Quah-Pandoc-Workflow-Markdown-PDF.md
My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical Writing

My Pandoc Markdown-PDF Workflow for Routine, Not Especially Technical, Writing

by Danny Quah, Aug 2020 (revised Jan 2022)

TL;DR: I write technical articles in LaTeX. But shorter, non-technical writings are easier to do in Markdown. How do I produce PDF from Markdown documents? Answer: provide YAML information in the Markdown; run Pandoc (typically through a Makefile or Atom's Markdown Preview Enhanced). To make all this work, some adjustment is needed in Pandoc options and template files.

Pandoc is a filter that takes a written document in a particular format, and produces a version of that same document in yet a different format. I use Pandoc primarily to transform Markdown documents to PDF, but I also draw on Pandoc to convert Word or ODT documents to Markdown. And vice versa.

Available official Pandoc documentation is voluminous. So as a matter of logic the knowledge to generate PDF from Markdown, to the user's desired degree of control, is already extant, out there somewhere. But a user j

fun prepend(xs: int list, ys: int list)=
if null xs
then ys
else (hd xs):: prepend( (tl xs), ys);
val xs = [4,5,6];
val ys = [1,2,3];
(* [4,5,6, 1,2,3] *)
prepend(xs, ys);
def bad_prepend(xs, ys):
if not xs:
return ys
else:
final_list = bad_prepend(xs[1:], ys)
final_list.insert(0, xs[0])
return final_list
x = [3,2,1]
y = [0,1,2]
@eff-kay
eff-kay / about.md
Created October 18, 2021 00:18 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer
@eff-kay
eff-kay / API design
Created June 24, 2021 02:36
Joshua Bloch: Bumper-Sticker API Design
All programmers are API designers:
Good programs are modular, and intermodular boundaries define APIs. Good modules get reused.
APIs can be among your greatest assets or liabilities:
Good APIs create long-term customers; bad ones create long-term support nightmares.
Public APIs, like diamonds, are forever:
You have one chance to get it right so give it your best.
APIs should be easy to use and hard to misuse:
gs \
-dCompatibilityLevel=1.4 \
-dCompressFonts=true \
-dSubsetFonts=true \
-dNOPAUSE \
-dBATCH \
-sDEVICE=pdfwrite \
-sOutputFile=$2 \
-c ".setpdfwrite <</NeverEmbed [ ]>> setdistillerparams" \
-f $1
@eff-kay
eff-kay / ast.py
Created April 7, 2020 00:42 — forked from buriy/ast.py
# from py2.6 distr
# -*- coding: utf-8 -*-
"""
ast
~~~
The `ast` module helps Python applications to process trees of the Python
abstract syntax grammar. The abstract syntax itself might change with
each Python release; this module helps to find out programmatically what
@eff-kay
eff-kay / cuda_10.0_installation_on_Ubuntu_18.04
Created March 9, 2020 03:56 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
CUDA 10.0 installation for Ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v10.0 and cudnn 7.5 in Ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
#!/bin/bash
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
@eff-kay
eff-kay / HttpsServer.py
Last active September 12, 2019 00:23
Simple ssh server python examples
#create key.pem and cert.pem using the following command
# >> openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365
import BaseHTTPServer, SimpleHTTPServer
import ssl
httpd = BaseHTTPServer.HTTPServer(('0.0.0.0', 443),
SimpleHTTPServer.SimpleHTTPRequestHandler)