Skip to content

Instantly share code, notes, and snippets.

View nakamura-to's full-sized avatar

Toshihiro Nakamura nakamura-to

View GitHub Profile
@nakamura-to
nakamura-to / EmbeddableSupport.kt
Last active May 25, 2016 12:53
Embeddable support in Doma (Kotlin)
@Embeddable
data class Address(val city: String, val street: String)
@Entity(immutable = true)
data class Person(@Id val id: Int, val name: String, val address: Address)
@nakamura-to
nakamura-to / Address.java
Last active May 25, 2016 12:49
Embeddable support in Doma
@Embeddable
public class Address {
private final String city;
private final String street;
public Address(String city, String street) {
this.city = city;
this.street = street;
}
public String getCity() {
return city;
@nakamura-to
nakamura-to / gist:c1c18dee82cabb8bc62d
Created September 13, 2015 16:22
type definitions for Redux applyMiddleware
type action = {
type: string;
};
type reducer = (state: any, action: action) => any;
type listener = () => void;
type dispatch = (action: action) => action;
select
age, name, birthday
from
person
order by
/*%if mode == 1 */
 age, name
/*%elseif mode == 2 */
/*# "name, age" */
/*%else */
@nakamura-to
nakamura-to / greeter-after.js
Last active August 29, 2015 14:09
react-toolsのjsxで変換
function Greeter(message) {"use strict";
this.greeting = message;
}
Greeter.prototype.greet=function() {"use strict";
return "Hello, " + this.greeting;
};
select email from table_a
where
primaryDomain = /*domain*/'hoge.com'
union
select email from table_b
where
/*%if userIds.size() > 0 */
member_id in /*userIds*/('aaa', 'bbb')
/*%else */
and
@nakamura-to
nakamura-to / spec.js
Created November 2, 2014 15:28
Karma reporter shows a wrong stacktrace when a promise is resolved in next event loop
'use strict';
describe('Karma reporter', function () {
var $rootScope;
var $q;
beforeEach(inject(function (_$rootScope_, _$q_) {
$rootScope = _$rootScope_;
$q = _$q_;
package boilerplate.entity;
import lombok.Data;
import org.seasar.doma.Entity;
import org.seasar.doma.GeneratedValue;
import org.seasar.doma.GenerationType;
import org.seasar.doma.Id;
import org.seasar.doma.SequenceGenerator;
import org.seasar.doma.Version;
using MvcApplication3.Controllers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;