Skip to content

Instantly share code, notes, and snippets.

View ne-sachirou's full-sized avatar

さっちゃん ne-sachirou

View GitHub Profile
@gakuzzzz
gakuzzzz / article.md
Last active October 29, 2019 06:19
「Javaで継続モナド」をScalaに翻訳/Scala Advent Calendar 2013

「Javaで継続モナド」をScalaに翻訳

この記事はScala Advent Calendar 2013の7日目の記事です。

昨日は @shogogg さんのScala + sbt-android + IntelliJ で快適Androidアプリ開発でした。

明日は @takezoux2 さんのScalaのParserCombinator実践入門+です。

継続モナドを調べていたら、@terazzo さんのJavaで継続モナドという記事が非常に判りやすかったんですが、サンプルコードがJavaのボイラープレートの嵐でちょっと読むのが辛い感じだったのでScalaで翻訳してみました、というのがこの記事です。

@s-hiiragi
s-hiiragi / get_termsize.rb
Last active May 1, 2023 16:22
端末のサイズ(列数,行数)を取得
# @name get_termsize.rb
# @desc 端末のサイズ(列数,行数)を取得
=begin
man
http://linuxjm.sourceforge.jp/html/LDP_man-pages/man4/tty_ioctl.4.html
/usr/include/sys/termios.h

OmniRuby

Omni completion engine for Ruby

初期リリースの草案です(草案)

機能,コンセプト

  • 標準クラス及び現在のファイル内で定義されたクラスのメンバをオムニ補完
@essen
essen / my_module.erl
Created October 14, 2013 03:25
Thinking in Erlang: The Code
-module(my_module).
-export([my_function/1, my_function/2]).
-export([infinite_loop/0, f/1, r/2, sort/1]).
-export([only_primes/1, is_prime/1]).
my_function(A) when is_integer(A) ->
my_function(A, 0);
my_function(A) when is_list(A) ->
my_function(list_to_integer(A), 0).
@kk6
kk6 / auto_attr_init.py
Created October 3, 2013 11:48
http://melborne.github.io/2013/09/27/auto-attr-set-in-ruby/ をPythonでやるとこれでいいのかなっていう。passなりreturnなり書かないとダメなのがダサいしそもそもPython的にはこういうのはキモいよねっていう。
#-*- coding:utf-8 -*-
from functools import wraps
import inspect
def auto_attr_init(f):
@wraps(f)
def _auto_attr_init(*args, **kwargs):
arg_values = args[1:] + inspect.getargspec(f).defaults
for pair in zip(f.__code__.co_varnames[1:], arg_values):

Thinking in Erlang

One day Erlang training.

Goals

This training should get you started with Erlang and understand how to design a highly available distributed system. Because there is only one day, we focus on the essential concepts and skip over many details that would be covered in the normal three days course.

@uupaa
uupaa / unsupportd_amd.md
Last active December 21, 2015 10:18
The typical module pattern が AMD に対応しない理由

The typical module pattern の「AMD をサポートしない理由」をこちらに移動しました。

AMD をサポートしない理由

  • AMDに対応しようとするとコードの上下に無視できない量のノイズ(コード)が乗ってしまいます
  • Node.js 上でAMDは正直使いどころがありません
  • 依存を解消するために、AMD 対応を行うと、今度は何らかのライブラリに依存することになります
  • Mobile WebApplication の エッジトレンドは、今後は WebWorkers にシフトすると考えており、WebWorkers には importScript があるため、AMD 対応する理由がないのです
@hokaccha
hokaccha / refinements.js
Last active December 17, 2015 03:48
JavaScript implementation of Ruby2.0 Refinements.
var Refinements = {};
Refinements.modules = {};
Refinements.register = function(name, fn) {
Refinements.modules[name] = fn;
};
Refinements.using = function() {
var args = Array.prototype.slice.call(arguments);
class Module
def wrap_package_private name
wraped_method = instance_method(name)
define_method(name) do |*args|
# check
puts "checking package_private: #{name}"
if true
e = NoMethodError.new("package private method is called from outside of the package")
e.set_backtrace caller
@repeatedly
repeatedly / ugomemo.d
Last active December 16, 2015 02:19
ugomemo.d
import std.json : JSONValue, parseJSON;
import std.stdio : writefln;
import std.net.curl : get;
void main()
{
auto apiRequest = (string uri) => parseJSON(get(uri));
auto user = apiRequest("http://ugomemo.hatena.ne.jp/11F9E990AA34FFBC@DSi.json");
auto movies = apiRequest("http://ugomemo.hatena.ne.jp/11F9E990AA34FFBC@DSi/movies.json");