Skip to content

Instantly share code, notes, and snippets.

View hangingman's full-sized avatar
🦙

hangedman hangingman

🦙
  • Kanagawa, Japan
  • 01:25 (UTC +09:00)
View GitHub Profile
@rmartinho
rmartinho / hate.markdown
Last active July 15, 2020 01:33
I will hate you

Dear C++ library writer,

  1. If your library forces me to use new all over, I will hate you.

  2. If your library has types with bogus values, I will hate you.

  3. If the documentation for your library gets the terminology of its own domain wrong, I will hate you.

  4. If I say "My God, it's full of stars!" when I see the function signatures in your library, I will hate you.

@syou6162
syou6162 / clj-seq-utils.md
Created September 6, 2012 00:24
Clojureのsequence関係のユーティリティ関数のまとめ

sequence関係のユーティリティ関数で自分がよく知らないものをまとめておく。

map-indexed

昔はindexedっていうそのまんまな関数があったけど、1.3くらいからなくなっていた。今はmap-indexedっていう関数を使う。よく使うのはこんな感じの使い方。

(map-indexed #(vector %1 %2) ["a" "b" "c" "d" "e"])
; ([0 "a"] [1 "b"] [2 "c"] [3 "d"] [4 "e"])

reductions

@pthariensflame
pthariensflame / higherkindedtypes.java
Last active May 2, 2022 08:05
Higher-Ranked types in Java
/**
* You can encode Haskell's `RankNTypes` extension in terms of
* the much less immediately powerful `PolymorphicComponents`
* extension. Java has a direct analogue to
* `PolymorphicComponents`: method-level generics!
*
* This class is useful for the demonstration, but does not
* itself make use of higher-ranked types. It simulates
* Haskell's `(->)` type constructor.
*/
@lvnilesh
lvnilesh / msql-cookbook-fails
Created November 8, 2012 15:03
mysql cookbook fails : Chef::Exceptions::Exec: apt-get -q -y install mysql-client=5.5.24-0ubuntu0.12.04.1 returned 100, expected 0
I created a folder for vagrant, edited Vagrantfile, created a cookbooks folder and
git clone https://github.com/opscode-cookbooks/mysql.git
git clone https://github.com/opscode-cookbooks/build-essential.git
git clone https://github.com/opscode-cookbooks/openssl.git
and then vagrant up but chef failed.
[2012-11-08T14:52:50+00:00] INFO: *** Chef 10.14.2 ***
[2012-11-08T14:52:50+00:00] INFO: Setting the run_list to ["recipe[build-essential]", "recipe[openssl]", "recipe[mysql]", "recipe[mysql::client]", "recipe[mysql::server]"] from JSON
[2012-11-08T14:52:50+00:00] INFO: Run List is [recipe[build-essential], recipe[openssl], recipe[mysql], recipe[mysql::client], recipe[mysql::server]]
[2012-11-08T14:52:50+00:00] INFO: Run List expands to [build-essential, openssl, mysql, mysql::client, mysql::server]
@ponkore
ponkore / clojure-reader-macro.md
Created December 3, 2012 15:32
Clojure のリーダーマクロについて (lisp reader macro advent calendar 2012 の記事です)。

Clojure のリーダーマクロについて

この記事は、lispリーダーマクロアドベントカレンダー の4日目の記事です。 タイトルにある通り、Clojure でのリー ダーマクロについて取り扱います(対象とする Clojure のバージョンは 1.4)。

はじめに

@Johniel
Johniel / tabbar+.el
Created December 18, 2012 01:22
tabbar.el extension
;;; tabbar+.el --- Tabbar extensions
;; Copyright (C) 2012
;; Author:
;; Keywords:
;; Version 0.2.2
;;; Commentary:
@omnisis
omnisis / H2EmbeddedTest.java
Last active February 29, 2020 14:16
Configuring H2 database for unit tests w/ spring
package examples.database;
import com.google.common.collect.Lists;
import examples.database.dao.PeopleDAO;
import examples.database.model.PeopleInfo;
import org.apache.commons.lang.time.StopWatch;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Test;
import org.junit.runner.RunWith;
@petitviolet
petitviolet / add_dictionary.py
Last active October 1, 2020 16:29
人名をMeCabの辞書に登録するためのスクリプト. 編集権限が無くても使える (http://d.hatena.ne.jp/petitviolet/20130214/1360809625
# -*- encoding:utf-8 -*-
import os
import sys
csv_path = '/home/hoge/user_dic/celebs.csv' # ユーザー辞書の元となるファイル
def add_dic(fname):
'''MeCabで使う辞書に人名を追加します
更新する人名はcsv形式のfname,
csvじゃないとき(人名を引数にした時)はそれ自体
更新するユーザー辞書は/home/hoge/user_dic/celebs.csv
@j5ik2o
j5ik2o / gist:5682650
Last active October 5, 2023 05:22
集約ってどんなもの?

グローバルな識別子を持つエンティティが集約になります。

ドメインモデル

  • 売上(Sale)
  • 売上明細(SaleDetail)

コード例

実装を書いてないメソッドもあるけど、適当に脳内でイメージしてね。

ドメイン層

@tomohiro
tomohiro / svn-to-github.md
Last active July 29, 2020 12:13
Subversion のリポジトリを Git リポジトリへ変換し GitHub に登録するまでの手順

Subversion のリポジトリを Git リポジトリへ変換し GitHub に登録するまで

Subversion ユーザ情報と Git ユーザ情報をマッチングするためのテキストファイルを作成

フォーマット: