This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fib x | x < 2 = x | otherwise = fib (x - 1) + fib (x - 2) | |
shit x | |
| x <= 0 = [] | |
| even x = x:shit (fib (x-1)) | |
| otherwise = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require-extension lowdown) | |
(markdown->htm) | |
$ ./main test.md | |
Error: unbound variable: markdown->htm | |
Call history: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require-extension lowdown) | |
(markdown->html current-input-port) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2.7 | |
# -*- coding: utf-8 -*- | |
### config ### | |
title = 'Blah blah blah!' | |
theme = '#000066' | |
font = ('Arial', '14px') | |
colors = ( | |
'#EEEEEE', # Background |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
klr@(none):~/tmp $ cat test.c | |
#include <stdio.h> | |
main() | |
{ | |
int c; | |
while ((c = getchar()) != EOF) | |
putchar(c); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# /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 |