Skip to content

Instantly share code, notes, and snippets.

@tarchan
tarchan / keyCombination.java
Created July 2, 2014 08:44
JavaFXでショートカットキーを設定する ref: http://qiita.com/tarchan@github/items/c45333fd987402f6307d
KeyCombination copyKey = KeyCombination.valueOf("Shortcut+c");
copyMenu.setAccelerator(copyKey);
Dim a = Date.Parse("09:00")
Dim b = Date.Parse("17:00")
Dim c = Date.Parse("01:00").TimeOfDay
Dim d = b - a - c
LocalTime a = LocalTime.parse("09:00");
LocalTime b = LocalTime.parse("17:00");
Duration c = Duration.between(LocalTime.MIN, LocalTime.parse("01:00"));
Duration d = Duration.between(a, b).minus(c);
// 月オブジェクトを取得
YearMonth currentMonth = YearMonth.now();
YearMonth backMonth = currentMonth.minusMonths(1);
YearMonth nextMonth = currentMonth.plusMonths(1);
// 日オブジェクトを取得
LocalDate firstDay = currentMonth.atDay(1);
LocalDate endDay = currentMonth.atEndOfMonth();
LocalDate endDay2 = currentMonth.atDay(currentMonth.lengthOfMonth());
public static final DateTimeFormatter TIME_PATTERN = DateTimeFormatter.ofPattern("HHmm");
public BigDecimal getRealKosu() {
LocalTime start = LocalTime.parse(strTime, TIME_PATTERN);
LocalTime end = LocalTime.parse(endTime, TIME_PATTERN);
LocalTime rest = LocalTime.parse(restTime, TIME_PATTERN);
Duration du = Duration.between(start, end);
Duration du2 = Duration.between(LocalTime.MIN, rest);
Duration du3 = du.minus(du2);
return new BigDecimal(du3.toMinutes() / 60.0);
@tarchan
tarchan / ircbot
Last active January 2, 2016 16:29
irc client idea
IRCClient bot = new IRCClient(config.json);
bot.addServer(name, host, port, nick, user, real, encoding, tls, rooms);
bot.addListener("join", new IRCListener() {
handle(IRCMessage msg) {
String line = msg.read();
msg.send("hello!");
}
}):
IRCNameManager nameManager = new IRCNameManager();
nameManager.addListener(new IRCListener(){

Untitled Slide

Welcome to Glide.

Glide is the easiest way to create useful slide for all of your Gists.

  • input key <- to go backward.
  • input key -> to go forward.

Publishing

@tarchan
tarchan / jsdoit.css
Created September 2, 2013 05:37
forked: 艦これ ウィークリー任務カウンター
.quest {
position:relative;
margin:10px ;
}
.content {
}
.title {
font-size:16px;
@tarchan
tarchan / repost.js
Last active December 19, 2015 08:19
コメント付きでURLを投稿します。
(function(){
var link = location.href;
var title = window.getSelection() + '' || document.title;
//var text = window.getSelection();
var quote = title + ' ' + link + ' ';
//var total = {};
//var year = '2012';
//var all = false;
var nick = 'たーちゃん';
function init() {
(function(){
var total = {};
var year = '2012';
var all = false;
function init(num) {
if(typeof num !== 'number') {
num = 0;
$('<div/>').css({
position: 'fixed',
left: 0,