Skip to content

Instantly share code, notes, and snippets.

@tlync
tlync / UserApiSpec.scala
Last active December 15, 2021 23:07
ScalaTest 2.0 RC1 with Play 2.2
import org.scalatest._
import org.scalatest.GivenWhenThen
import play.api.libs.json._
import play.api.test._
import play.api.test.Helpers._
class UserApiSpec extends FunSpec with GivenWhenThen with Matchers {
describe("Users API") {
describe("GET /users") {
@tlync
tlync / gist:6694291
Created September 25, 2013 02:06
minimum DDD base
class Id[V](val id: V)
trait Entity[T <: Id[_]] {
val id: T
}
case class User(id: Id[String]) extends Entity[Id[String]]
trait Repository[ID <: Id[_], E <: Entity[ID]] {
def find(id: ID): E
@tlync
tlync / gist:5855758
Last active December 18, 2015 22:39
InteliJ IDEA Keybindings

自分用 Intelij IDEA Keybindings

Key Action Note
C + ; Complettion
S + C + ; Smart Completion
⌘ + . Next Error
⌘ + S + . Previous Error
C + ' Quick Fix
C + S + T Open Testing Pair
@tlync
tlync / private.xml
Created June 20, 2013 08:31
Disable keyremap4macbook's emacs keybindings in InteliJ IDEA and enable a portion of bindings.
<?xml version="1.0"?>
<root>
<appdef>
<appname>INTELIJ</appname>
<equal>com.jetbrains.intellij</equal>
</appdef>
<replacementdef>
<replacementname>EMACS_MODE_IGNORE_APPS</replacementname>
<replacementvalue>
@tlync
tlync / .sbtconfig
Last active December 14, 2015 16:29
SBT_OPTS="-Dfile.encoding=UTF-8 -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
@tlync
tlync / split-json.js
Created September 1, 2012 06:08
Split large json file
if(process.argv.length < 3){
console.log('target file path is required.')
process.exit(1)
}
var target = process.argv[2]
console.log('file: ' + target)
var fs = require('fs')
fs.readFile(target, function (err, data) {
diff --git a/dict/dict.mak b/dict/dict.mak
index 49435d6..eea60e6 100644
--- a/dict/dict.mak
+++ b/dict/dict.mak
@@ -6,7 +6,7 @@
DICT = migemo-dict
DICT_BASE = base-dict
-SKKDIC_BASEURL = http://openlab.ring.gr.jp/skk/dic
+SKKDIC_BASEURL = http://www.ring.gr.jp/archives/elisp/skk/dic
--- a/src/wordbuf.c 2011-08-15 02:57:05.000000000 +0900
+++ b/src/wordbuf.c 2011-08-15 02:57:17.000000000 +0900
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <limits.h>
#include "wordbuf.h"
#define WORDLEN_DEF 64
--- a/dict/dict.mak
+++ b/dict/dict.mak
@@ -6,7 +6,7 @@
DICT = migemo-dict
DICT_BASE = base-dict
-SKKDIC_BASEURL = http://openlab.ring.gr.jp/skk/dic
+SKKDIC_BASEURL = http://www.ring.gr.jp/archives/elisp/skk/dic
SKKDIC_FILE = SKK-JISYO.L
EUCJP_DIR = euc-jp.d
@tlync
tlync / jquery-fastclick.js
Created May 18, 2012 11:23
jquery-fastclick.js
(function($){
var hasTouch = 'ontouchstart' in window
$.fn.fastclick = function(fn, delay, amount){
delay = delay || 50
amount = amount || 10
// browser fallback
if(!hasTouch){