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
| ;; シェルを開いてコマンドを実行する | |
| (defun exec-shell (command &optional silent-exec) | |
| (let ((buffer (current-buffer))) | |
| (shell) | |
| (insert-string command) | |
| (comint-send-input) | |
| (if (null silent-exec) | |
| () | |
| (switch-to-buffer buffer) | |
| ) |
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
| /* -*- tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | |
| /* vim:set ts=2 sw=2 sts=2 et: */ | |
| // | |
| // @brief Firefox Add-on SDK traits test. | |
| // @author ongaeshi | |
| // @date 2011/04/23 | |
| // @url https://jetpack.mozillalabs.com/sdk/1.0b4/docs/packages/api-utils/docs/traits.html | |
| const { Trait } = require('traits'); |
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
| // | |
| // @brief | |
| // @author ongaeshi | |
| // @date 2011/04/24 | |
| const { Trait } = require("traits"); | |
| function formatNum(keta, num) { | |
| var src = new String(num); | |
| var cnt = keta - src.length; |
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 String | |
| def underscore | |
| dup.gsub(/::/, '/'). | |
| gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2'). | |
| gsub(/([a-z\d])([A-Z])/,'\1_\2'). | |
| tr("-", "_"). | |
| downcase | |
| end | |
| 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
| require 'tempfile' | |
| str = <<EOF | |
| Lorem ipsum | |
| Lorem ipsum dolor sit amet, | |
| consectetur adipisicing elit, | |
| sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, | |
| quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. | |
| EOF |
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
| require 'matrix' | |
| # http://d.hatena.ne.jp/tanku/20100318/1268930228 | |
| # http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-math/575 | |
| require 'quaternion' | |
| class Vector | |
| def outer_product(o) | |
| raise 'size#{self.size}' unless size == 3 | |
| Vector[ | |
| self[1] * o[2] - self[2] * o[1], |
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 | |
| mkdir -p zip | |
| for v in `ls` | |
| do | |
| if test "$v" != "zip" -a "$v" != "zip-archive.sh"; then | |
| # echo $v | |
| tar czvf zip/$v.tar.gz $v | |
| fi |
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
| // hashの同値比較 | |
| exports.equalHash = function(a, b) { | |
| let k = Object.keys(a); | |
| if (k.length != Object.keys(b).length) | |
| return false; | |
| for (let i = 0; i < k.length; i++) { | |
| if (a[k[i]] != b[k[i]]) | |
| return false; |
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
| # VisualStudio向けの.gitignore | |
| /bin/ | |
| /obj/ | |
| *.user | |
| *.suo | |
| _ReSharper.* | |
| *.sln.cache |
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
| // @file console-dir.js | |
| // @brief | |
| // @author ongaeshi | |
| // @date 2011/06/02 | |
| // | |
| // -------------------------------------- | |
| // console.dir({a: 1, b: 2, c: 3}); | |
| // => | |
| // info: | |
| // a: 1 |