Skip to content

Instantly share code, notes, and snippets.

View funrep's full-sized avatar

Karl-Oskar Rikås funrep

View GitHub Profile
fib x | x < 2 = x | otherwise = fib (x - 1) + fib (x - 2)
shit x
| x <= 0 = []
| even x = x:shit (fib (x-1))
| otherwise = []
;; Main source file, command-line argument parsing
;; See LICENSE for licensing information
(use args ports)
(include "init.scm")
(include "post.scm")
(include "build.scm")
(define prog "stipes")
(define version "0.1")
(define author "kalle97r at gmail.com")
(require-extension lowdown)
(markdown->htm)
$ ./main test.md
Error: unbound variable: markdown->htm
Call history:
(require-extension lowdown)
(markdown->html current-input-port)
# cat.py
import argparse
parser = argparse.ArgumentParser(prog='cat.py')
parser.add_argument('file', nargs='+', help='file(s) to print and catenate')
def main():
args = parser.parse_args()
files = open(args.file, 'r').read()
print files
# this code:
import argparse
parser = argparse.ArgumentParser(prog='cat.py')
parser.add_argument('file', help='file to print and catenate')
main():
args = parser.parse_args()
file = open(args.file, 'r').read()
@funrep
funrep / posty
Created November 1, 2012 16:16
blablabla
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
### config ###
title = 'Blah blah blah!'
theme = '#000066'
font = ('Arial', '14px')
colors = (
'#EEEEEE', # Background
#!/usr/bin/env python2.7
import os, sys, getopt
def main():
opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
for o, a in opts:
output = a
klr@(none):~/tmp $ cat test.c
#include <stdio.h>
main()
{
int c;
while ((c = getchar()) != EOF)
putchar(c);
}
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain arch
::1 localhost.localdomain localhost
# End of file