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
print 'hello python' |
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
#!/bin/sh | |
export CLOJURE_EXT=$HOME/.clojure | |
export CLOJURE_OPTS="-Xmx1g -server" | |
LIBS=$(ls -1 $CLOJURE_EXT/* 2> /dev/null) | |
export CLASSPATH=.:$CLOJURE_EXT:$CLASSPATH:"$(echo "$LIBS" | tr \\n :)" | |
JAVA=${CLOJURE_JAVA:-java} | |
OPTS=${CLOJURE_OPTS:-} |
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
(use '[clojure pprint repl]) | |
(use '[clojure.java shell browse javadoc jdbc]) | |
(load-file (str (System/getenv "HOME") "/.clojure.clj")) | |
(def completions (mapcat (comp keys ns-publics) (all-ns))) | |
(with-open [f (java.io.BufferedWriter. (java.io.FileWriter. (str (System/getenv "HOME") "/.clj_completions")))] | |
(.write f (apply str (interleave completions (repeat "\n"))))) |
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
Object.clone = function (o) { | |
var obj = Object.create(Object.getPrototypeOf(o)), | |
prop = Object.getOwnPropertyNames(o); | |
for (var i = prop.length, p; i--;) { | |
p = prop[i]; | |
Object.defineProperty(obj, p, Object.getOwnPropertyDescriptor(o, p)); | |
} | |
return obj; | |
}; |
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
function toInt(number) { | |
return number && + number | 0 || 0; | |
} | |
console.log(toInt("1")); // 1 | |
console.log(toInt("1.2")); // 1 | |
console.log(toInt("-1.2")); // -1 | |
console.log(toInt(1.2)); // 1 | |
console.log(toInt(0)); // 0 | |
console.log(toInt("0")); // 0 |
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
def get_Monday(d): | |
return d + datetime.timedelta(days=-d.weekday()) |
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
;;; The following lines added by ql:add-to-init-file: | |
#-quicklisp | |
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp" | |
(user-homedir-pathname)))) | |
(when (probe-file quicklisp-init) | |
(load quicklisp-init))) | |
;;; Check for --no-linedit command-line option. | |
(if (member "--no-linedit" sb-ext:*posix-argv* :test 'equal) | |
(setf sb-ext:*posix-argv* |
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
(let (symbols) | |
(do-all-symbols (sym) | |
(let ((package (symbol-package sym))) | |
(cond | |
((not (fboundp sym))) | |
((or (eql #.(find-package :cl) package) | |
(eql #.(find-package :cl-user) package)) | |
(pushnew (symbol-name sym) symbols)) | |
((eql #.(find-package :keyword) package) | |
(pushnew (concatenate 'string ":" (symbol-name sym)) symbols)) |
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
(set-language-environment 'Chinese-GB) | |
(set-keyboard-coding-system 'utf-8) | |
(set-clipboard-coding-system 'utf-8) | |
(set-terminal-coding-system 'utf-8) | |
(set-buffer-file-coding-system 'utf-8) | |
(set-default-coding-systems 'utf-8) | |
(set-selection-coding-system 'utf-8) | |
(modify-coding-system-alist 'process "*" 'utf-8) | |
(setq default-process-coding-system '(utf-8 . utf-8)) | |
(setq-default pathname-coding-system 'utf-8) |
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
(defun funny (funny) | |
"funny..." | |
(if (zerop funny) | |
:funny | |
(list | |
(cons funny | |
(let ((funny funny)) | |
(setq funny (1- funny)) | |
(funny funny))) | |
funny))) |
OlderNewer