Skip to content

Instantly share code, notes, and snippets.

View nyuichi's full-sized avatar

Yuichi Nishiwaki nyuichi

View GitHub Profile
@mhayashi1120
mhayashi1120 / twittering-stream.el
Created July 16, 2011 06:54
twitter stream mode parasite to twittering-mode
;;; twittering-stream.el --- Twitter stream extension.
;; Author: Masahiro Hayashi <mhayashi1120@gmail.com>
;; Keywords: twitter user stream
;; Emacs: GNU Emacs 22 or later
;; Version: 0.0.2
;; Package-Requires: ((json "1.2") (twittering-mode "2.0"))
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
@domenic
domenic / await.js
Last active December 16, 2015 11:38
Speculative idea for `await` in JS
// Let `doAjax`, `fadeIn`, `fadeOut`, and `delay` be promise-returning functions.
// In all the following examples, `example` is meant to return a promise that is fulfilled when
// all operations are completed, or rejected if any of the steps fail.
// ES5
function example() {
return doAjax("data.json").then(function (data) {
document.getElementById("data").innerText = data;
@pocketberserker
pocketberserker / AsyncInCSharpAndFSharp.ja.rst
Last active October 6, 2022 02:53
Async in C# and F#: Asynchronous gotchas in C# (Japanese translation)

C# と F# の Async: C# の非同期の落とし穴

原文:Async in C# and F#: Asynchronous gotchas in C#
原文著者:Tomas Petricek (@tomaspetricek)
翻訳者:@pocketberserker

2月に、私は毎年恒例のMVPサミット ── Microsoft が MVP のために主催するイベント ── に出席しました。私はボストンとニューヨークを訪問する機会を利用して、二つの F# に関する講演と Channel9 lecture about type providers の収録を行いました。他のすべての活動(しばしばパブで他の F#er を議論に巻き込んだり、朝まで長い睡眠)にもかかわらず、私はいくつかの講演に参加し果せました。

@kazuho
kazuho / gist:6052876
Created July 22, 2013 10:26
JavaScript の yield で非同期なコードを動機っぽく書く例
// based on http://labs.cybozu.co.jp/blog/kazuho/archives/2007/05/coopthread.php
function get_all(urls) {
runnable(function (next) {
for (var i = 0; i < urls.length; i++) {
// build request
var xhr = new XMLHttpRequest();
xhr.open("get", urls[i], true);
xhr.onreadystatechange = function () {
if (xhr.readyState == 4)
next(xhr.responseText);
@KOBA789
KOBA789 / parser.js
Created August 28, 2013 03:35
実際動かない(struct リテラルくらいしかパースできない)
var util = require('util');
function Nothing () {}
Object.Nothing = Nothing;
Array.prototype.maybeMap = function (callback, thisArg) {
var T, A, k;
if (this == null) {
throw new TypeError(" this is null or not defined");
@omasanori
omasanori / gist:8023683
Last active December 31, 2015 17:59
R'0'RSを読む

R'0'RSを読む

これは`Lisp Advent Calendar 2013`_の19日目の文章です。

はじめに

表題に出てくるR'0'RSは正式な名称ではありません。表題で私がR'0'RSと呼んでいる文章はSchemeの言語仕様を記述した報告書、いわゆるRnRSの元祖といえる"Scheme: An Interpreter for Extended Lambda Calculus"です。この文章はAI Memo 349としても知られています。以下ではAIM 349と呼びます。

@tsdeng
tsdeng / emacs_scala.md
Last active June 26, 2018 16:43
Configure Emacs for Scala

Basic Support

  1. Install ctags-exuberant
  2. Install gnu global
    • brew install global --with-exuberant-ctags
    • add following line in bash export GTAGSCONF=/usr/local/share/gtags/gtags.conf
    • edit gtags.conf, in the exuberant-ctags section, add following line :langmap=Scala:.scala:\
@chaitanyagupta
chaitanyagupta / _reader-macros.md
Last active May 19, 2024 19:25
Reader Macros in Common Lisp

Reader Macros in Common Lisp

This post also appears on lisper.in.

Reader macros are perhaps not as famous as ordinary macros. While macros are a great way to create your own DSL, reader macros provide even greater flexibility by allowing you to create entirely new syntax on top of Lisp.

Paul Graham explains them very well in [On Lisp][] (Chapter 17, Read-Macros):

The three big moments in a Lisp expression's life are read-time, compile-time, and runtime. Functions are in control at runtime. Macros give us a chance to perform transformations on programs at compile-time. ...read-macros... do their work at read-time.

@gakuzzzz
gakuzzzz / 1_.md
Last active August 2, 2023 01:59
Scala の省略ルール早覚え

Scala の省略ルール早覚え

このルールさえ押さえておけば、読んでいるコードが省略記法を使っていてもほぼ読めるようになります。

メソッド定義

def concatAsString(a: Int, b: Int): String = {
  val a_ = a.toString();
  val b_ = b.toString();

各言語での Map, Dictionary 的なものの名前

CommonLisp:
hash-table
Scheme:
hash-table (SRFI-69), hashtable (R6RS Scheme)
Haskell:
Map

OCaml: