This file contains 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
(ns wgetjava.handler | |
(:require [clojure.java.io :as io] | |
[clojure.string :as str] | |
[org.ozias.cljlibs.shell.shell :refer :all] | |
[org.ozias.cljlibs.utils.core :refer :all]) | |
(:import (clojure.lang PersistentArrayMap PersistentVector))) | |
(def ^{:private true :doc "cookies temp file path"} | |
cookies-path (to-path (tmpdir) "cookies.txt")) |
This file contains 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
(defn- target | |
"generate a target from a user and host string. | |
If user and host are nil, evaluates to localhost. | |
If host is nil, evaluates to user@localhost. | |
If user is nil, evaluates to host. | |
Otherwise evaluates to user@host." | |
[user host] | |
(let [host (if (string? host) host "localhost") | |
user (if (string? user) (str user "@") "")] | |
(str user host))) |
This file contains 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
// Original.... | |
def max(xs: List[Int]): Int = { | |
def findMax(curr: Int, l: List[Int]): Int = { | |
if (l.isEmpty) | |
curr | |
else if (l.head > curr) | |
findMax(l.head, l.tail) | |
else | |
findMax(curr, l.tail) | |
} |
This file contains 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/python3 | |
import argparse | |
import os | |
from os import environ | |
from subprocess import check_call | |
# Store the current directory | |
owd = os.getcwd() | |
# Setup the supported command-line arguments |
NewerOlder