Skip to content

Instantly share code, notes, and snippets.

@tomoTaka01
tomoTaka01 / Sample.java
Created July 30, 2016 07:35
Java NIO -> NIO2 (UnmappableCharacterException error occur)
package com.sample;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@tomoTaka01
tomoTaka01 / Target1.java
Last active June 21, 2016 13:02
Unit test for files
package com.test;
import java.io.BufferedWriter;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.Arrays;
import java.util.List;
@tomoTaka01
tomoTaka01 / TestFile.java
Last active June 21, 2016 07:44
Creating two files and check if they are equal. The two files are different charset and line separator.
package com.test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
@tomoTaka01
tomoTaka01 / PrintLineSeparator.java
Last active June 21, 2016 07:04
Confirm line separator for Windows and Mac, since the below code is executed in Mac.
package com.test;
public class PrintLineSeparator {
public static void main(String... args) {
new PrintLineSeparator().printCrLf();
}
private void printCrLf() {
String crlf = "\r\n";
String lf = System.getProperty("line.separator");
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
[[ -s "/Users/tomo/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/tomo/.sdkman/bin/sdkman-init.sh"
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
export SDKMAN_DIR="/Users/tomo/.sdkman"
[[ -s "/Users/tomo/.sdkman/bin/sdkman-init.sh" ]] && source "/Users/tomo/.sdkman/bin/sdkman-init.sh"
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
@tomoTaka01
tomoTaka01 / .gitconfig
Created April 16, 2016 23:28
config for git(need to add more...)
[user]
name = tomo taka
email = [email protected]
[core]
editor = vim
excludesfile = ~/.gitignore
[push]
default = matching
[color]
@tomoTaka01
tomoTaka01 / .vimrc
Last active May 5, 2016 08:23
setting for vim (using solarized[ ~/.vim/colors/solarized.vim FYR:http://ethanschoonover.com/solarized] for the color). will add some more later...
set number
set title
set tabstop=4
set shiftwidth=4
"tab key 4 space
set softtabstop:0
set expandtab
set smartindent
set list
"for colors
@tomoTaka01
tomoTaka01 / index.html
Created December 5, 2015 06:55
HTML file for Server Sent Event JavaScript Sample
<!DOCTYPE html>
<html>
<head>
<title>Server Sent Event Sample</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<h2>Server Sent Event Sample</h2>
<div>
@tomoTaka01
tomoTaka01 / filesample2.html
Created November 7, 2015 00:56
FileUpload sample with AngularJs(refer to http://luxiyalu.com/angular-all-about-inputfile/)
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<title>file upload sample</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="js/vender/bootstrap-3.3.5-dist/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<h1>file upload sample</h1>
<!DOCTYPE html>
<html>
<head>
<title>file upload sample</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="js/vender/bootstrap-3.3.5-dist/css/bootstrap.css" rel="stylesheet">
</head>
<body>
<h1>file upload sample</h1>