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
... | |
_nS('controllers.admin.Products'); _root.controllers.admin.Products.search = | |
function() { | |
return _wA({method:"POST", url:"/" + "admin/product/search"}) | |
} | |
... |
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
@(field:Field, min:Int=1)(f: (Field, Int) => Html) | |
@{ | |
(0 until math.max(if (field.indexes.isEmpty) 0 else field.indexes.max + 1, min)).map(i => f(field("[" + i + "]"),i)) | |
} |
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
Datomic.q(Query( | |
s"""[:find ?name | |
:in $$ | |
:where [_ :db/ident ?ident] | |
[(namespace ?ident) ?ns] | |
[(name ?ident) ?name] | |
[(= ?ns "namespace_name")] | |
]""" | |
), database).foreach { | |
case name: String => println(name) |
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 play.api.data._ | |
import play.api.data.format._ | |
import play.api.data.format.Formats._ | |
/** | |
* Option[T]をクエリとして解決するためのバインダ(必須でないパラメータなどに利用することを想定) | |
* 通常のFormと同様にbindFromRequestして使う | |
* クエリに該当するキーが含まれていない場合にはFormの値がNoneになる | |
* | |
* こんなかんじ (もっときれいに書きたいけど): |
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": "this-web-scale", | |
"version": "0.0.1", | |
"scripts": { | |
"dev": "node server.js", | |
"build": "NODE_ENV=production next build", | |
"start": "NODE_ENV=production node server.js", | |
"dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker", | |
"deploy": "eb use this-web-scale-production && eb deploy --label v$npm_package_version --verbose", | |
"build:docker": "docker build -t $npm_package_config_docker_image:$npm_package_version -t $npm_package_config_docker_image:latest .", |
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
OldHttpRequest = Turbolinks.HttpRequest | |
class Turbolinks.CachedHttpRequest extends Turbolinks.HttpRequest | |
constructor: (_, location, referrer) -> | |
super(this, location, referrer) | |
requestCompletedWithResponse: (response, redirectedToLocation) -> | |
@response = response | |
@redirect = redirectedToLocation | |
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
#!/bin/sh | |
# this script requires root | |
# be sure to run the following before running this: | |
# $ sudo su | |
# since there's an issue piping the curl response to bash | |
# just download the install script | |
curl -sL https://deb.nodesource.com/setup_6.x > install_node.sh |
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 javax.inject.{Inject, Singleton} | |
import akka.stream.Materializer | |
import play.api.Configuration | |
import play.filters.cors.CORSConfig.Origins.Matching | |
import play.filters.cors.{CORSConfig, CORSFilter} | |
import scala.concurrent.ExecutionContext | |
import scala.util.matching.Regex |
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
const https = require('https') | |
const { parse } = require('url') | |
const next = require('next') | |
const fs = require('fs') | |
const dev = process.env.NODE_ENV !== 'production' | |
const app = next({ dev }) | |
const handle = app.getRequestHandler() | |
const options = { |
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 ws.eiennohito.utils.serialization | |
import java.lang.reflect.Modifier | |
import java.util.concurrent.ConcurrentHashMap | |
import akka.serialization.Serializer | |
import com.google.protobuf.CodedOutputStream | |
import com.trueaccord.scalapb.{GeneratedMessage, GeneratedMessageCompanion} | |
import com.typesafe.scalalogging.StrictLogging |
OlderNewer