This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test2es | |
import org.elasticsearch.client.Client | |
import org.elasticsearch.node.NodeBuilder | |
import org.elasticsearch.node.Node | |
class Access2ES { | |
private final Client client |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE sosickdev DEFAULT CHARACTER SET utf8; | |
CREATE USER sosickdev IDENTIFIED BY '$PASS'; | |
use sosikdev; | |
GRANT ALL PRIVILEGES ON sosickdev.* TO sosickdev@$HOSTNAME IDENTIFIED BY '$PASS' | |
SET PASSWORD FOR sosickdev@$HOSTNAME=PASSWORD('$PASS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* http://stackoverflow.com/questions/19009299/scala-parser-combinators-consume-until-match | |
* | |
* | |
*/ | |
import scala.util.parsing.combinator.RegexParsers | |
object MyParser extends RegexParsers { | |
val beginToken: Parser[String] = "begin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
str = " | |
abc | |
def | |
ghi | |
jkl | |
mno | |
pqr | |
stu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sample | |
import scalikejdbc._ | |
import SQLInterpolation._ | |
/** | |
* http://scalikejdbc.org/ | |
* | |
*/ | |
object Main { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name := "use-kuromoji" | |
version := "1.0" | |
scalaVersion := "2.10.2" | |
libraryDependencies ++= Seq( | |
"org.apache.lucene" % "lucene-core" % "3.6.0" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.collection.mutable.HashMap | |
object CheckUnique { | |
def main (args: Array[String]) { | |
val str = "abc" | |
val res = checkUnique(str) | |
println(str + "->" + res.toString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object CheckSame { | |
def main(args: Array[String]) { | |
println(checkSame("abca", "bcaa")) | |
println(checkSame("abc", "bcaa")) | |
} | |
/** | |
* check the sameness of each words by sort | |
* refs: http://www.ne.jp/asahi/hishidama/home/tech/scala/sample/sort.html#h_scala |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export base_url=http://jellyfish85.com/sosick | |
export username=**** | |
export userpass=**** | |
curl -XGET -c cookie.txt ${base_url}/users/auth/twitter | |
export oauth_token= | |
curl -XPOST -b cookie.txt -d "session[username_or_email]=${username}" -d "session[password]=${userpass}" https://api.twitter.com/oauth/authorize?oauth_token=$oauth_token | grep veri | |
export oauth_verifier= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Printf("hello, world\n") | |
} |
OlderNewer