Skip to content

Instantly share code, notes, and snippets.

@zeta709
zeta709 / mdserver.zsh
Last active February 2, 2022 14:47
Simple markdown server; pandoc;
mdserver() {
if [ "$#" -ne 1 ]; then
echo "Usage: mdserver file.md"
return
fi
local TMP="$HOME/tmp"
mkdir -p "$TMP" || return
local CSS="markdown_pandoc.css"
if [ ! -r "$TMP/$CSS" ]; then
@zeta709
zeta709 / 00-short-tips.md
Last active December 21, 2015 14:49
short tips; delete a newline at end of file; pygmentize; random password generator

작은 팁 모음

  • gist 설명 부분에 내용을 적어야 빠른 검색이 된다.
@zeta709
zeta709 / time.c
Last active December 20, 2015 22:49
Measuring execution time of a function.
#include <stdio.h>
volatile int tmp;
static const int N = 123456789;
/* Linux method #0: use gettimeofday() (obsolete?)
*/
#include <sys/time.h>
// timeradd, timersub, etc. macros are _BSD_SOURCE.
// Those will be defined only if the symbol __USE_BSD is defined.
@zeta709
zeta709 / Makefile
Created August 12, 2013 04:33
Makefile for c and cpp.
# Run 'make -p' to see make's default variables
#COMPILE.c = $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
#LINK.o = $(CC) $(LDFLAGS) $(TARGET_ARCH)
CFLAGS = -std=c99 -Wall -Wextra -O2
LDLIBS =
TARGET = main
SRCS = main.c mylib.c
OBJS = $(SRCS:.c=.o)