Skip to content

Instantly share code, notes, and snippets.

@DenBeke
DenBeke / cwk_to_pdf.py
Created August 26, 2019 18:52
Appleworks / ClarisWorks to PDF converter script
import os
import subprocess
import sys
def file_to_pdf(root, name):
'''
file_to_pdf converts a single file to PDF
'''
@DenBeke
DenBeke / copy.go
Created August 24, 2017 18:54 — forked from r0l1/copy.go
Copy a directory tree (preserving permissions) in Go.
// CopyFile copies the contents of the file named src to the file named
// by dst. The file will be created if it does not already exist. If the
// destination file exists, all it's contents will be replaced by the contents
// of the source file. The file mode will be copied from the source and
// the copied data is synced/flushed to stable storage.
func CopyFile(src, dst string) (err error) {
in, err := os.Open(src)
if err != nil {
return
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
# PWD
set_color $fish_color_cwd
sudo docker run -it -p 9000:9000 -v /home/:/home/ --net="host" osminogin/php-fpm
@DenBeke
DenBeke / external_command.swift
Last active December 5, 2015 11:59
Executing external command with Swift
import Foundation
func executeCommand(command: String, args: [String]) -> String {
let task = NSTask()
task.launchPath = command
task.arguments = args
let pipe = NSPipe()