Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

KenjiMorita kenmori

🏠
Working from home
View GitHub Profile
@kenmori
kenmori / UserEntity.java
Created Jan 7, 2017
【glassFish】これが出たら疑う箇所Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.EntityManagerSetupException
View UserEntity.java
@Entity
@SecondaryTables({
@SecondaryTable(name = "zipcode_tbl"),//not much!!
@SecondaryTable(name = "address_tbl"),
})
@Table(name="user_data_2")
public class UserEntity02 implements Serializable {
@Id @NotNull
private String id;
private String name;
@kenmori
kenmori / persistence.xml
Created Jan 7, 2017
【JavaDB/glassFish】解決!Internal Exception: java.sql.SQLSyntaxErrorException: 表またはビュー'[TABLE_NAME]'は存在しません。
View persistence.xml
<properties>
<!--add this code, if you use eclipselink -->
<property name="eclipselink.ddl-generation" value="create-tables"/>
@kenmori
kenmori / uninstall.sh
Created Jan 8, 2017
【Rust/rustup/multirust】uninstallしたい!「rustup cannot be installed alongside [Rust|multirust]. Please uninstall first」rustcが邪魔してrustupがinstallできない場合1つの方法
View uninstall.sh
sudo /usr/local/lib/rustlib/uninstall.sh
@kenmori
kenmori / index.md
Created Feb 5, 2017
イベントデリゲーション
View index.md

問321

イベントデリゲーションに関して。 こちらのDOMの

<ul id="todo-app">
  <li class="item">Walk the dog</li>
  <li class="item">Pay bills</li>
  <li class="item">Make dinner</li>
@kenmori
kenmori / Child-keys-must-be-unique.js
Last active Feb 10, 2017
keyを持つコードとkeyを持たないコード【React】これ。Warning: flattenChildren(...): Encountered two children with the same key, `keyName`. Child keys must be unique; when two children share a key, only the first child will be used.
View Child-keys-must-be-unique.js
////////no key////////keyを持たないで返しているコード///
const users = this.state.users.map(function (user){
return <User id={user.id} name={user.name} />;
});
////////add key//////keyを設定して返しているコード///
const users = this.state.users.map(function (user){
return <User id={user.id} key={user.id} name={user.name} />;
});
@kenmori
kenmori / gist:6c3cb9d5d6a15205a9a54a15e7fad37e
Last active Feb 15, 2017
flowtype/react. Required module not found
View gist:6c3cb9d5d6a15205a9a54a15e7fad37e
import React, { Component } from 'hogehogefolder/react';//error react. Required module not found
const MailToBtn = ({mailAddress, addClass, children }: Props) => (
<a className='block w100 ' href={mailAddress}>
<button className={`${addClass} appearanceNone outlineNone btnMain btnShadow1 size1 type1 btn100 pad0`} type='button'>
{children}
</button>
</a>
)
export default MailToBtn
View .flowtype.config
[ignore]
.*/node_modules/.*
[include]
./resources/es6
[libs]//add flowtyed folder
./resources/decls
[options]
@kenmori
kenmori / enterns.js
Created Feb 15, 2017
add flowtyped js file to folder after set libs in .flowtype.config 【flowtype】これ。react. Required module not found
View enterns.js
declare module 'hogehogefolder/react' {
declare module.exports: any;
}
@kenmori
kenmori / Required-module-not-found.txt
Created Feb 15, 2017
react. Required module not found
View Required-module-not-found.txt
resources/es6/hogehoge/components/stateless/Button/MailToBtn.js:3
3: import React, { Component } from 'tel_fortune_lib/react';
^^^^^^^^^^^^^^^^^^^^^^^ hogehogefolder/react. Required module not found
@kenmori
kenmori / flowtype.js
Created Feb 18, 2017
【flowtype/React/Class】これ。how to fix 「Covariant property `[fn]` incompatible with contravariant use in ``` assignment of property `[fn]`」
View flowtype.js
////error
this._increment = this._increment.bind(this);
^^^^^^^^^^ property `_increment`. Covariant property `_increment` incompatible with contravariant use in
27: this._increment = this._increment.bind(this);
^^^^^^^^^^^^^^^ assignment of property `_increment`
/////// code ////////
constructor(props: Props){
super(props);
this.state = {