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/env ruby | |
| # coding: utf-8 | |
| target = ARGV[0] | |
| module ProjectFile | |
| module ModuleMethods | |
| def root | |
| @root ||= File.dirname(__FILE__) | |
| end |
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
| class TypeClass<T> { | |
| private static class Id<T> { | |
| public static T __id__ | |
| } | |
| public static trait Mixin<T> { | |
| public T id() { return this.__id__ } | |
| public void id(T a) { this.__id__ = a } | |
| public String toString() { return "${this.class.getName()}<${T.getName()}>(${id()})" } |
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
| module SandboxHelper | |
| require 'set' | |
| class Sandbox | |
| def initialize(application) | |
| @base = application | |
| @virt = application.clone | |
| end |
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
| // | |
| // 新規タブでクロネコヤマトの荷物問い合わせする関数 | |
| // | |
| // | |
| // function kuroneko(id) { | |
| // | |
| // var target = 'kuroneko' | |
| // | |
| // window.open('',target); |
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
| def add = { a -> { b -> { c -> | |
| return a + b + c; | |
| }}}; | |
| println add(1)(2)(3); | |
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
| function curry(f) { | |
| if (f.length <= 1) { | |
| return f; | |
| } else { | |
| return function(x) {return curry(f.bind(null,x));}; | |
| } | |
| } |
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
| (define-module (clojure core) | |
| #:use-module (ice-9 format) | |
| #:use-module (srfi srfi-1) | |
| #:use-module (srfi srfi-45) | |
| #:use-module (oop goops) | |
| #:replace (map filter) | |
| #:export (-> ->> doto loop str println time slot lazy-seq seq first rest nth take drop dorun doall doseq range line-seq fib-seq)) | |
| (define-syntax -> | |
| (syntax-rules () |
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
| (define-syntax -> | |
| (syntax-rules () | |
| ((_ x) x) | |
| ((_ x (form more ...)) (form x more ...)) | |
| ((_ x form) (form x)) | |
| ((_ x form more ...) (-> (-> x form) more ...)))) | |
| (define-syntax ->> | |
| (syntax-rules () |
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
| ;;----------------------------- | |
| ;; Load *.config.el | |
| ;;----------------------------- | |
| (defvar loaded-config '()) | |
| (defun config-el-p (conf) | |
| (string-match "\\.config\\.el$" conf)) | |
| (defun loaded-config-p (conf) |
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
| (defmacro -> (x &rest forms) | |
| (if (null forms) x | |
| (let ((head (car forms))) | |
| (cond ((listp head) | |
| `(-> (,(car head) ,x ,@(cdr head)) ,@(cdr forms))) | |
| ((symbolp head) | |
| `(-> (,head ,x) ,@(cdr forms))) | |
| (t | |
| `(-> ,head ,@(cdr forms))))))) |