Skip to content

Instantly share code, notes, and snippets.

@hikaruworld
hikaruworld / capture.js
Last active December 21, 2017 04:10
puppeteerを使ったE2Eテストにマニュアル用キャプチャを組み込む ref: https://qiita.com/hikaruworld@github/items/6ef5ee0752aaa2fff2b4
// node capture.js で実行するとactual_images/以下にそれぞれのスナプショットが保存される。
const puppeteer = require("puppeteer");
(async () => {
// ブラウザを起動
// わかりやすいように、ヘッドレスモードをOFFにして、各アクションに300msec遅延させる
const browser = await puppeteer.launch({
headless: false,
slowMo: 300,
});
@hikaruworld
hikaruworld / component.test.js
Last active June 13, 2017 07:30
vueの単一ページコンポーネントのテストをkarmaなしで行う ref: http://qiita.com/hikaruworld@github/items/d9948e29d8353cb41c7f
import Vue from "vue";
import ExampleView from "components/ExampleView.vue";
import { mount } from "avoriaz";
describe("components/ExampleView", () => {
describe("computed", () => {
describe("hello", () => {
it("workが返される", () => {
const wrapper = mount(ExampleView, {
propsData: {
@hikaruworld
hikaruworld / file0.txt
Last active August 29, 2015 14:12
Sails-redisを利用した際に`Details: AdapterError: Record does not satisfy unique constraints`で失敗する ref: http://qiita.com/hikaruworld@github/items/573aeff93a3edacae7c9
var user = {id: "", title: "test"};
delete user.id
User.create(user).exec(console.log);
module.exports = {
// 中略
ssl: {
key: require("fs").readFileSync(__dirname + "/../ssl/key.pem"),
cert: require("fs").readFileSync(__dirname + "/../ssl/cert.pem")
}
// 中略
}
// src/main/scala/plugin/PluginSystem.scala#L51
// デフォルトはこれだけが定義されている
repositoriesList += PluginRepository("central", "https://github.com/takezoe/gitbucket_plugins.git")
// ローカルリポジトリを追加
// git://は駄目な模様
repositoriesList += PluginRepository("local", "https://github.com/hikaruworld/test")
@hikaruworld
hikaruworld / Dockerfile-gitbucket
Created August 2, 2014 06:05
Jetty上のGitBucketを構築するDockerfile(centOS向け)
FROM centos:centos6
# 依存ライブラリインストール
RUN yum install -y which
RUN yum install -y java7
RUN yum install -y wget
RUN yum install -y tar
# jettyの起動用ユーザーを作成
RUN useradd -s /sbin/nologin jetty
@PersistenceUnit
private EntityManager entityManager;
public List<ApplicationUser> find() {
List<ApplicationUser> list = this.entityManager
.createNamedQuery("ApplicationUser.find", ApplicationUser.class)
.setFirstResult(0)
.setMaxResults(10)
.getResultList();
@hikaruworld
hikaruworld / file0.txt
Created June 3, 2014 11:32
@EmbeddedIdによって埋め込まれた@embeddableな複合PKのうち一つのフィールドを@GenereatedValueしたい(暫定対応)。 ref: http://qiita.com/hikaruworld@github/items/a0e34c86dbefb4b6d1f7
@Entity
@Table(name = "SAMPLE_USER", catalog = "")
@Data
public class SampleUser implements Serializable {
private static final long serialVersionUID = 1L;
@EmbeddedId
@GeneratedValue(strategy = GenerationType.IDENTITY)
protected SampleUserPK sampleUserPK;
@Column(name = "UPDATE_DATE")
@Temporal(TemporalType.TIMESTAMP)
@hikaruworld
hikaruworld / file0.html
Created March 2, 2014 13:58
JSF2.2でHTML5 Friendly Markupを用いてstylesheetの設定するために ref: http://qiita.com/hikaruworld@github/items/ff5758884fe1af36b6a0
<link rel="stylesheet" href="css/common.css" type="text/css" jsfc="h:outputStylesheet" library="css" name="common.css"/>
@hikaruworld
hikaruworld / .bashrc
Created March 2, 2014 13:34
asadminでbash_complecationを有効にする ref: http://qiita.com/hikaruworld@github/items/aed33254483a4ba4a5eb
if [ -f /Applications/NetBeans/glassfish-4.0/bash_completion.d/asadmin ]; then
. /Applications/NetBeans/glassfish-4.0/bash_completion.d/asadmin
fi