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
| ;;----------------------- | |
| ;; WIP | |
| ;;----------------------- | |
| (defn deep-reverse [l] | |
| (cond (not (coll? l)) l | |
| (= (count l) 0) [] | |
| (= (count l) 1) (deep-reverse (first l)) | |
| :else [(deep-reverse (rest l)) (deep-reverse (first l))] |
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 (make-exponentiation x n) | |
| (cond ((= n 0) 1) | |
| ((= n 1) x) | |
| (else (list '** x n)))) | |
| (define (exponentiation? x) | |
| (and (pair? x) (eq? (car x) '**))) | |
| (define (base x) | |
| (cadr 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
| ;; HipChatのJabber IDが 1234_5678@chat.hipchat.com の場合 | |
| (require 'jabber-autoloads) | |
| ;; HipChat | |
| (defvar hipchat-number "1234") | |
| (defvar hipchat-full-number (concat hipchat-number "_5678")) | |
| (defvar hipchat-nickname "Foo Bar") | |
| (defvar hipchat-server "chat.hipchat.com") | |
| (defvar hipchat-full-name (concat hipchat-full-number "@" hipchat-server)) |
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/python | |
| # -*- coding: utf-8 -*- | |
| # https://github.com/mattn/growl-for-linux | |
| # https://github.com/kfdm/gntp | |
| # http://code.google.com/p/feedparser/ | |
| # https://github.com/serverdensity/python-daemon | |
| import gntp.notifier | |
| import feedparser |
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
| // appreciate for http://sakuratan.biz/archives/3393 | |
| var sys = require('sys'), | |
| fs = require('fs'), | |
| jsdom = require('jsdom'), | |
| jqSrc = 'https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js', | |
| content, | |
| document, | |
| window; |
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
| String filename = getFilename(); | |
| InputStream is = getFileContent(); | |
| MultipartEntity mEntity = new MultipartEntity(HttpMultipartMode.STRICT, null, Charset.forName("UTF-8")); | |
| mEntity.addPart(filename, new InputStreamBody(is, filename)); | |
| ByteArrayOutputStream oaos = new ByteArrayOutputStream(); | |
| try { | |
| mEntity.writeTo(oaos); | |
| } catch (IOException e) { |
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
| var chars = ['a', 'w', 'b', 'b', 'c', 'w', 'q', 'e', 'w', 'u', 't', 'e', 'b', 'b', 'e', '1', 'e', '2', 'e']; | |
| var set = Object.create(null), | |
| result = chars.filter(function (i) { | |
| var bl = set[i]; | |
| set[i] = true; | |
| return bl; | |
| }).sort().reverse().reduce(function (a, b) { | |
| return a + (a.indexOf(b) < 0 ? b : ''); | |
| }); |
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
| // ==UserScript== | |
| // @name user.js template | |
| // @namespace http://hoge.co.jp/ | |
| // @include http://foo.com/* | |
| // @exclude | |
| // @author xorphitus | |
| // @description this is a template of user script | |
| // @version 0.0.1 | |
| // ==/UserScript== |
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
| /*global jQuery */ | |
| (function ($, window) { | |
| "use strict"; | |
| $.fn.lazyload = function (options) { | |
| var orgSrcAttr = options.orgSrcAttr || 'original', | |
| altImgSrc = options.altImgSrc, | |
| timeout = isNaN(options.timeout) ? 3000 : options.timeout, // milli sec | |
| deferred = typeof options.deferred === 'boolean' ? options.deferred : true, | |
| targets, |
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
| import java.io.File | |
| import jxl._ | |
| val xlsDir = "./xls" | |
| new File(xlsDir).listFiles.foreach ({ xlsFile => | |
| Workbook.getWorkbook(xlsFile).getSheets.filter(_.getName.matches("[A-Z_]+")).foreach({ sheet => | |
| val group = sheet.getCell(2, 1).getContents | |
| for (row <- 3 until sheet.getRows()) { | |
| val category = sheet.getCell(0, row).getContents |
NewerOlder