Skip to content

Instantly share code, notes, and snippets.

@tango238
tango238 / Par.scala
Created March 6, 2016 02:00
parMapの実装
import java.util.concurrent._
object Par {
type Par[A] = ExecutorService => Future[A]
def unit[A](a: A): Par[A] = (es: ExecutorService) => UnitFuture(a)
def lazyUnit[A](a: => A): Par[A] = fork(unit(a))
private case class UnitFuture[A](get: A) extends Future[A] {
#!/usr/bin/env scalas
// @see http://eed3si9n.com/ja/scripting-with-scala
// chmod +x database_sample.scala
// export CONSCRIPT_OPTS="-XX:MaxPermSize=512M -Dfile.encoding=UTF-8"
// ./database_sample.scala
/***
scalaVersion := "2.11.7"
@tango238
tango238 / script.scala
Last active December 18, 2015 09:40
Slick Practice (Dec 18, 2015)
#!/usr/bin/env scalas
// @see http://eed3si9n.com/ja/scripting-with-scala
// chmod +x script.scala
// export CONSCRIPT_OPTS="-XX:MaxPermSize=512M -Dfile.encoding=UTF-8"
// ./script.scala
/***
scalaVersion := "2.11.7"
@tango238
tango238 / Gruntfile.js
Last active December 27, 2015 20:49
A sample project of Knockout.js and Karma
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
karma: {
unit: {
configFile: 'karma.conf.js',
autoWatch: true
}
@tango238
tango238 / codeception.md
Last active December 27, 2015 01:59
Use of Codeception

=============== Acceptance Test

Create StepObjects

php codecept.phar generate:stepobject acceptance Member

Create PageObjects

# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "centos64_64"
config.vm.define :web do |india|
india.vm.host_name = "india"
india.vm.network :hostonly, "192.168.50.12"
@tango238
tango238 / india.json
Last active December 16, 2015 11:19
chef nginx
{
"nginx": {
"port" : 80
},
"run_list":[
"yum::epel",
"nginx"
]
}
echo " (^·. )\ (^·. )\ /( .·´ ::’·._) ·. (::::.... .. .:\(
) ^·. .·´( .·´ ( ) ^·. .·´( .·´ ( /( )\ ) ^·._):::. ) ’ .·´( )::. ..:::).·´;·:: ´ ´\::.::....:·´
.·´( .·´:..::(,(::-- \:·´ .·´( .·´:..::(,(::-- \::.^·._) ^·.’ )\ .·´ .:^·.(:;; -- \:. :(.·´) )\ ):..\(;;::-- ´ ´ \:::::::..::)
\:::....::::·´ _\’ );; :-- \::....:::::).· (,): -- \....:::^·.( ( (::...:/\ ¯¯¯¯¯¯ /·.
)..:::·´ ,..:´::: / .·´/\ ,...__ ¯¯¯^ ·:·´’):.::/\ ¯¯¯^ · ::·´’ ^·:/::::\...:’/ ___________/..::)
^·::/ /::::::::/ )/::: \...:´/ /:::::::::::/ / ^·:/::::\...:´/ ____ \ \::::/::::/ /:::
@tango238
tango238 / Application.scala
Created December 8, 2012 10:08
変態アドベントカレンダー2012 8日目
package controllers
import play.api._
import play.api.libs.concurrent._
import play.api.libs.ws._
import play.api.mvc._
import scala.xml._
object Application extends Controller {
@tango238
tango238 / dump-aout.groovy
Created November 4, 2012 10:03
dump a.out
// http://www.iecc.com/linker/linker03.html
// Figure 2: a.out header
// int a_magic; -- magic number
// int a_text; -- text segment size
// int a_data; -- initialized data size
// int a_bss; -- uninitialized data size
// int a_syms; -- symbol table size
// int a_entry; -- entry point
// int a_trsize; -- text relocation size