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/expect -f | |
| # sudo apt-get install expect | |
| spawn ssh [email protected] | |
| expect "assword:" | |
| send "xxxx\$xxxxxx\r" | |
| interact |
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
| package main | |
| import "github.com/disintegration/imaging" | |
| import "fmt" | |
| func main() { | |
| srcImage, err := imaging.Open("/home/itang/Downloads/logo.jpg") | |
| if err != nil { | |
| fmt.Printf("%v", err) | |
| } |
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
| (ns tools.dist | |
| (:require [me.raynes.fs :as fs] | |
| [clojure.java.shell :as shell] | |
| [app.util :refer :all])) | |
| (def ^:const JAR_FILE "target/tdb-0.1.0-SNAPSHOT.jar") | |
| (def ^:const TARGET_DIR "/tmp/mex") | |
| (def ^:const TARGET_LIB_DIR (str TARGET_DIR "/lib")) |
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
| #_(defn select-values-ordered | |
| "" | |
| [m keys] | |
| (loop [ks keys ret []] | |
| (if (seq ks) | |
| (recur (next ks) (conj ret (get m (first ks)))) | |
| ret))) | |
| (defn select-values-ordered | |
| "获取指定keys的值序列" |
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
| #_(defhandler do-login [username password req t locale] | |
| (v/rule (v/is-email? username) [:username (t locale :validation.passport/email)]) | |
| (v/rule (v/has-value? password) [:password (t locale :validation.passport/password)]) | |
| (v/rule (>= (count password) 6) [:password "密码至少6位"]) | |
| (if (v/errors?) | |
| (do | |
| (views/flash-put! "warning" (v/get-errors)) | |
| (response/redirect "/passport/login")) | |
| (do | |
| (session/put! :user username) |
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
| (ns tdb.core | |
| (:gen-class) | |
| (require [korma.db :refer :all]) | |
| (require [korma.core :refer :all]) | |
| (require [clojure.string :as str])) | |
| (defdb prod | |
| (postgres {:db "dbname" | |
| :user "xxx" | |
| :password "xxxx" |
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
| lein ancient | |
| [org.clojure/core.match "0.2.2"] is available but we use "0.2.0" | |
| [org.clojure/core.typed "0.2.72"] is available but we use "0.2.17" | |
| [org.clojure/tools.nrepl "0.2.6"] is available but we use "0.2.3" | |
| [org.clojure/tools.reader "0.8.10"] is available but we use "0.7.10" | |
| [commons-codec "1.9"] is available but we use "1.8" | |
| [environ "1.0.0"] is available but we use "0.4.0" | |
| [me.raynes/conch "0.7.0"] is available but we use "0.5.1" | |
| [me.raynes/fs "1.4.6"] is available but we use "1.4.5" | |
| [crypto-random "1.2.0"] is available but we use "1.1.0" |
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
| <!--[if lte IE 9]> | |
| <div id="warning_info" class="text-warning fade in mb_0"> | |
| <button data-dismiss="alert" class="close" type="button">×</button> | |
| <strong>您正在使用低版本浏览器,</strong> 在本页面的显示效果可能有差异。 | |
| 建议您升级到 | |
| <a href="http://www.google.cn/intl/zh-CN/chrome/" target="_blank">Chrome</a> | |
| 或以下浏览器: | |
| <a href="www.mozilla.org/en-US/firefox/" target="_blank">Firefox</a> / | |
| <a href="http://www.apple.com.cn/safari/" target="_blank">Safari</a> / | |
| <a href="http://www.opera.com/" target="_blank">Opera</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
| #!/bin/bash lein-exec | |
| (use '[leiningen.exec :only [deps]]) | |
| (deps '[[clj-http "1.0.0"] | |
| [cljtang "0.1.6"]]) | |
| (require '[clj-http.client :as client]) | |
| (require '[cljtang.lib :refer [repeat-str]]) | |
| (defn request-get-baidu [] |
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
| public class Main { | |
| public static void main(String[] args) { | |
| new Thread(() -> { | |
| System.out.println("Hello"); | |
| sleep(1000); | |
| System.out.println("Exit!"); | |
| }).start(); | |
| } |