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
/** | |
* Forces an number observable to be wrapped around the specified inclusive range [min, max]. | |
* If specified, options.onWrap will be called back when the 'wrapping' occurs | |
* (i.e. the write attempt of the value out of the range). | |
* options.onWrap will be called with an argument false on underflow, or true on overflow. | |
* | |
* @param {ko.observable} target | |
* @param {{min: number, max: number, onWrap: ?function(boolean), onWrapOwner: ?*}} options | |
* @return {ko.computed} wrapped 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
fs = require 'fs' | |
path = require 'path' | |
async = require 'async' | |
commander = require 'commander' | |
gas_manager = require 'gas-manager' | |
request = require 'request' | |
util = require 'gas-manager/out/lib/commands/util' | |
main = -> | |
commander |
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 $exp-convert | |
(use srfi-1) | |
(use util.match) | |
(export | |
$exp-list->sexp) | |
;;; port->$exp-listで読まれたものをS式に変換する。 | |
(define ($exp-list->sexp $exp) | |
($ reverse |
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
-- nyaos_filter_quote_eval.lua | |
-- bash風な逆クォートのカッコ版。ネスト可能。 | |
-- 「echo $(echo bar $(echo foo))」は「bar foo」と出力される。 | |
function nyaos.filter.quote_eval(cmdline) | |
return cmdline:gsub('%$(%b())', function(m) | |
local result, err = nyaos.eval(string.sub(m, 2, -2)) | |
if err then | |
print('error in substitution: '..err) | |
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
#!/usr/bin/ruby-1.9 | |
require 'nokogiri' | |
# cf. http://help.disqus.com/customer/portal/articles/472150 | |
def tag(n,c='') "<#{n}>#{c}</#{n}>" end | |
def t(n,c='') print tag(n, c) end | |
doc = File.open("comments.xml", encoding:'utf-8'){|f| Nokogiri::XML f } |
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 'weakref' | |
# ニュース。グローバルpubsub。 | |
# | |
# News.newsで発信。こんなふうに書く。 | |
# | |
# 誰かの誕生日があったことを発信する。 | |
# | |
# def tick | |
# News.news(:birthday) if @month == 10 && @day == 5 |
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
=begin | |
made with dotgame: https://gist.github.com/962107 | |
参考: http://www.nintendo.co.jp/3ds/asrj/movie/movie.html?mov=3back | |
nバックは20+2n問出るのかな | |
nバックでは、m番目の問題を見ながら(n-m)番目の問題に答える | |
問題は上から流れてくる | |
each_consみたいな具合 |
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
@if exist "%~f1" @( | |
echo pushd "%~f1" | |
pushd "%~f1" | |
) else @for %%i in (%1.lnk) do @( | |
for /f %%n in ('perl -x "%~f0" %%~$path:i') do @( | |
echo pushd %%n | |
pushd %%n | |
) | |
) | |
@exit /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
#ifndef INCLUDED_BULLET_HPP_ | |
#define INCLUDED_BULLET_HPP_ | |
#include "btBulletDynamicsCommon.h" | |
namespace bullet_wrapper { | |
// 使うクラスの目次がわりのtypedef | |
typedef btDiscreteDynamicsWorld World; |