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
snippet class | |
abbr class Class(...): ... | |
class ${1:Name}(${2:object}): | |
"""${3:class documentation}""" | |
def __init__(self, ${4}): | |
"""${5:__init__ documentation}""" | |
${6:pass} | |
snippet def | |
abbr def function(...): ... |
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
import os, tempfile | |
t = tempfile.NamedTemporaryFile() | |
path = os.path.abspath(t.name) | |
open(path) |
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
--- pit.py.orig 2009-12-22 03:49:04.953125000 +0900 | |
+++ pit.py.added 2009-12-22 03:47:37.671875000 +0900 | |
@@ -18,13 +18,15 @@ | |
else: | |
if not os.environ.has_key('EDITOR'): | |
return {} | |
- t = tempfile.NamedTemporaryFile() | |
+ t, path = tempfile.mkstemp() | |
c = yaml.dump(opts['config'] if opts.has_key('config') else Pit.get(name) ,default_flow_style=False) | |
t.write(c) |
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! Test() | |
let l:foo = 1 | |
python << __END__ | |
print type(vim.eval('l:foo')) | |
print type(1) | |
__END__ | |
endfunction | |
call Test() |
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
;; 第1回 Scheme コードバトン | |
;; | |
;; ■ これは何か? | |
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール | |
;; | |
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。 |
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
;;; base64.clj --- Base64 encode/decode utility | |
;; | |
;; Copyright (c) 2010 OGINO Masanori <[email protected]> | |
;; | |
;; Permission is hereby granted, free to charge, to any person obtaining a | |
;; copy of this software and associated documentation files (the "Software"), | |
;; to deal in the Software without restriction, including without limitation | |
;; the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
;; and/or sell copies of the Software, and to permit persons to whom the | |
;; Software is furnished to do so, subject to the following conditions: |
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 First Edition Of Scheme Code Baton | |
;; | |
;; * What Is This? | |
;; This is a recreation that we pass Scheme codes as a baton and enjoy it | |
;; changed to something interesting. | |
;; Results are make public at Shibuya.lisp (event about Lisp held in Shibuya, | |
;; Japan). | |
;; We want code baton being a chance to write codes for beginner and to read | |
;; others codes for middles. | |
;; |
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 rand-assign | |
[n] | |
(take n (repeatedly #(rand-nth [true false])))) | |
(defn clause-satisfied? | |
[assign clause] | |
(some #(= (nth assign (first %)) (second %)) clause)) | |
(defn formula-satisfied? | |
[assign formula] |
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 | |
^{:author "OGINO Masanori" | |
:see-also [["http://www.cs.nott.ac.uk/~gmh/book.html" "Programming in Haskell"]] | |
:doc "A library to make certain number from some numbers. | |
This library solves a well-known problem called \"Ten Puzzle\" or \"Countdown | |
Problem\", but the target number is not limited to 10. You can get any integer | |
or rational number. Also, the number of source numbers is not limited to 4. | |
Note that source numbers are *not always* used once, but never or once. |
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 bar | |
"Other namespace." | |
(:use foo)) | |
(println "WARNING: constructor functions are enabled from 1.3 series!") | |
(println "WARNING: for now, try beta version at your risk.") | |
(println "Simple constructor: ->Point" | |
(->Point 10 20)) |
OlderNewer