Skip to content

Instantly share code, notes, and snippets.

View myokoym's full-sized avatar
💭
hi

Masafumi Yokoyama myokoym

💭
hi
View GitHub Profile
@briancavalier
briancavalier / simple-promise-retry.js
Created February 24, 2011 18:35
A few general patterns for retries using promises
function keepTrying(otherArgs, promise) {
promise = promise||new Promise();
// try doing the important thing
if(success) {
promise.resolve(result);
} else {
setTimeout(function() {
keepTrying(otherArgs, promise);
@udzura
udzura / README.rdoc
Created May 15, 2011 05:38
rack-rewrite README in japanese
@domenic
domenic / promise-retryer.js
Last active September 16, 2023 02:43
Generalized promise retryer
"use strict";
// `f` is assumed to sporadically fail with `TemporaryNetworkError` instances.
// If one of those happens, we want to retry until it doesn't.
// If `f` fails with something else, then we should re-throw: we don't know how to handle that, and it's a
// sign something went wrong. Since `f` is a good promise-returning function, it only ever fulfills or rejects;
// it has no synchronous behavior (e.g. throwing).
function dontGiveUp(f) {
return f().then(
undefined, // pass through success
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@arika
arika / groonga-pry.rb
Last active August 29, 2015 14:08
run groonga command on pry
#!/usr/bin/env ruby
# encoding: utf-8
#
# Requirements:
# * groonga command
# * jq command <http://stedolan.github.io/jq/>
# * pry 0.10.x
#
# Configuration:
# * ~/.groonga-pryrc
@ongaeshi
ongaeshi / README.md
Last active August 29, 2015 14:16
Groonga 4.0.3 to 5.0.0 test (on Windows)

概要

  • Groonga 5.0.0 のインストールは成功
  • GRN_IO_VERSION=1にして、古いバージョンのデータベースを開こうとしたら動かなかった(command.log)
    • 古いデータベースとの互換性は上手くいっていない気がする
    • 検索しようとしてGroongaに問い合わせるとエラーが出る印象
  • milk rebuild -all してデータベースを作り直したら上手く動いた
    • ディスク容量はとても小さくなった
    • 心なしか動作も軽快な気もする
  • 一週間ほど新データベースで動かした感じ、ちゃんと動いている模様
@nohamelin
nohamelin / xseei.export-all.js
Last active October 28, 2022 10:45
Export your search engines in only-WebExtensions Mozilla Firefox builds
// -sp-context: browser
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* xseei.export-all.js
* ===================
* code-revision 3
* https://gist.github.com/nohamelin/6af8907ca2dd90a9c870629c396c9521
@nohamelin
nohamelin / xseei.import.js
Last active October 28, 2022 10:45
Import search engines in only-WebExtensions Mozilla Firefox builds
// -sp-context: browser
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* xseei.import.js
* ===============
* code-revision 2
* https://gist.github.com/nohamelin/8e2e1b50dc7d97044992ae981487c6ec