Skip to content

Instantly share code, notes, and snippets.

@haru01
haru01 / gitconfig_alias
Created June 11, 2014 00:22
gitconfig_alias
[alias]
co = checkout
st = status -s
pr = pull --rebase
c = commit
a = add
al = add -A .
au = add -u
ap = add -p
b = branch
@haru01
haru01 / gist:06c6b53a279f0d6ce9ed
Last active August 29, 2015 14:19
Event 中心に
// 学習用
// * See Also http://ookami86.github.io/event-sourcing-in-practice/#how-eventsourcing-works/04-restoring-objects-5.md
// * http://martinfowler.com/eaaDev/EventSourcing.html
//
function BanckingAccount(id, owner, balance, version) {
this.id = id || 0;
this.owner = owner || "";
this.balance = balance || 0;
this.version = version || 0;
}
'use strict';
var fetch = require('node-fetch');
var assert = require('power-assert');
function fetchPost() {
return fetch("http://jsonplaceholder.typicode.com/posts/1")
.then(function(res) {
return res.json();
}).catch(function(e) {
require 'natto'
word_counters = {}
nm = Natto::MeCab.new
Dir::entries(".").select { |f| f.match /^ch.*\.re$/}.each do |file|
File.open(file, "r") do |f|
f.each_line do |line|
nm.parse(line) do |n|
word_counters[n.surface] = word_counters[n.surface] ? word_counters[n.surface] + 1 : 1
Sub セル結合()
Selection.Merge
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
End With
End Sub
Sub 同値セル結合()
Application.DisplayAlerts = False
(let ((x 0))
(do ()
((not (< x 3)))
(print x)
(setq x (1+ x))))
(defmacro while (test &body body)
`(do ()
((not ,test))
,@body))
> coffee -e -p "number: 42"
(function(){
var number;
number = 42;
})();
> coffee -e -p "square: (x) -> x * x"
(function(){
var square;
square = function square(x) {
return x * x;
};
})();
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>CoffeeScript Sandbox</title>
</head>
<body>
<script type="text/coffeescript">
alert "hello coffee"
</script>
gem list | while read n v; do sudo gem uninstall $n -a ; done