Skip to content

Instantly share code, notes, and snippets.

View taichi's full-sized avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
#!/bin/bash
# run sudo apt update or similar and feed the password for the rest to run smooth
# this is for the old bash based on ubuntu 14.04
sudo apt update && sudo apt dist-upgrade -y
# Instlall NodeJS, Yarn and npm related dependencies
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
@taichi
taichi / git-blame-pr.js
Last active December 28, 2017 08:06 — forked from kazuho/git-blame-pr.pl
git-blame by PR #
const { spawn, spawnSync } = require('child_process');
const readline = require('readline');
const blame = spawn('git', ['blame', '--first-parent', process.argv[2]]);
const lines = readline.createInterface({ input: blame.stdout });
const lookup = hash => {
const ret = spawnSync('git', ['show', '--oneline', hash]);
const msg = /Merge\s+(?:pull\s+request|pr)\s+\#?(\d+)\s/i;
const matcher = msg.exec(ret.stdout.toString());
@taichi
taichi / gist:41603d7029e9cf18482b91cc933a1413
Created April 11, 2016 08:21 — forked from teppeis/gist:d7f40170902a9a4144a2
TypeScript用フルスタック型付きライブラリのご提案 (https://gist.github.com/teppeis/10659631 は間違えて消しちゃったので再投稿)
@taichi
taichi / tomcat.conf
Last active August 29, 2015 14:15 — forked from witscher/tomcat.conf
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
# run as non privileged user
# add user with this command:
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# -lt 1 ]; then
echo 'Usage: apt-rdepends-tree [-r] <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
package de.am.gc.benchmarks;
import java.util.ArrayList;
import java.util.List;
/**
* GC benchmark producing a mix of lifetime=0 and lifetime>0 objects which are kept in randomly updated lists.
*
* @author jsound
*/

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

オリジナルは力武さんの投稿 http://erlang-users.jp/ml/erlang/index.cgi?0::166
アキュムレータ accumulator
アノテーション annotation
アリティ arity
ー致条件 match specification
入れ子リスト deep list
インターフェイス interface
エクスポート export
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Urabe, Shyouhei
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@taichi
taichi / ch7_1.js
Last active December 16, 2015 02:39 — forked from torazuka/ch7_1.js
var exports = {};
// parse URI
exports.parse_url = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/;
exports.names = ['url', 'scheme', 'slash', 'host', 'port', 'path', 'query', 'hash'];
exports.blanks = '@';
// parse number
exports.parse_number = /^-?\d+(?:\.\d*)?(?:e[+\-]?\d+)?$/i;