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
<div style='width:200px; margin:auto; border:1px solid #ddd; text-align:center; border-radius:25px;'> | |
<div style='margin:15px;'></div> | |
<div style='width:40px; height:5px; margin:auto; border:1px solid #ddd; text-align:center; border-radius:20px;'> </div> | |
<div style='margin:15px;'></div> | |
<div style='width:190px; height:300px; margin:auto; border:1px solid #ddd'> | |
<div style='margin:100px;'></div> | |
<label>Title</label> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nulla magna, mattis in nulla eu, tempus gravida massa. Duis vitae porta velit. Suspendisse in ultricies ante. Integer venenatis, erat nec tincidunt gravida, velit felis laoreet metus, sed ullamcorper felis tellus congue odio. Maecenas ullamcorper, tortor vel luctus dictum, mauris risus tincidunt nisl, id molestie libero arcu sagittis dolor. Praesent in felis at turpis pharetra sagittis id ut ante. Vestibulum tempus cursus erat, eget varius sem. Vivamus imperdiet efficitur libero. Nulla ut arcu lacinia, |
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
public class ResourceReader{ | |
/* | |
* filePath 是檔案所在的 package ,將 "." 改為 "/" | |
* 例如檔案 config.txt 所在 package 是 my.resource | |
* 則 filePath = "my/resource/config.txt" | |
*/ | |
public void readResource(String filePath){ | |
InputStream in = ResourceReader.class.getClassLoader().getResourceAsStream(filePath); | |
} | |
} |
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
em.remove(em.contains(entity)? entity: em.merge(entity)); |
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
/* | |
* Paste this code in SublimeText3 -> Preferences -> Key Bindings-User to enable emmet for jsx | |
*/ | |
[{ | |
"keys": ["tab"], | |
"command": "expand_abbreviation_by_tab", | |
"context": [ | |
{ | |
"operand": "source.js", | |
"operator": "equal", |
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
var BookmarksIsEmpty = React.createClass({ | |
render: function(){ | |
return ( | |
<div className='bookmark-empty'> | |
<img src='http://2.bp.blogspot.com/-uS_sqEbi9Po/U4K7HV1_XII/AAAAAAAAARQ/jv5z0zvIyGw/s1600/Pikachu.600.1445652.jpg' /> | |
</div> | |
); | |
} | |
}); |
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
var webpack = require("webpack"); | |
module.exports = { | |
entry:{ | |
//左邊字串就是下方 output 區塊的 [name],透過這種方式就可以把檔案輸出到不同路徑下 | |
'popup/popup' : './app/main/src/pages/popup/popup.js', | |
'settings/settings' : './app/main/src/pages/settings/settings.js' | |
}, | |
output: { | |
filename: '[name].bundle.js', |
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
/* | |
* some useful utilities | |
*/ | |
// check an object is empty or not | |
function isEmpty(obj) { | |
for(var prop in obj) { | |
if(obj.hasOwnProperty(prop)) | |
return false; | |
} |
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
chocolatey install guide |
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
var React = require("react"); | |
module.exports = React.createClass({ | |
..., | |
// open new spotify oauth window | |
handleLoginRequest: function(){ | |
var url = 'https://accounts.spotify.com/authorize' + | |
'?client_id=' + this.props.clientId + | |
'&redirect_uri=' + encodeURIComponent(this.props.redirectUri) + | |
'&scope=' + encodeURIComponent(this.props.scope) + |
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
public static <T, E> Set<T> getKeysByValue(Map<T, E> map, E value) { | |
Set<T> keys = new HashSet<T>(); | |
for (Entry<T, E> entry : map.entrySet()) { | |
if (entry.getValue().equals(value)) { | |
keys.add(entry.getKey()); | |
} | |
} | |
return keys; | |
} |
NewerOlder