Skip to content

Instantly share code, notes, and snippets.

View syuchan1005's full-sized avatar
🌊
Hunting job

Shuichi Sato syuchan1005

🌊
Hunting job
View GitHub Profile
@4oi
4oi / BannerUtils.java
Created November 30, 2015 17:09
バナーにcharを書き込むユーティリティ
/*
* Copyright (C) 2015 Toyblocks
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@keepoff07
keepoff07 / 2015-09-21.java
Last active April 1, 2019 22:09
ymlを必要としないコマンドの登録
try {
Constructor<?> cs = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
cs.setAccessible(true);
PluginCommand cmd = (PluginCommand)cs.newInstance("setblock", this);
cmd.setDescription("This is command description.");
cmd.setUsage("/<command> <x> <y> <z> <TileName> [dataValue] [dataTag]");
cmd.setPermission("minecraft.command.setblock");
cmd.setPermissionMessage("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.");
cmd.setExecutor(new CommandExecutor() {
@keepoff07
keepoff07 / 2015-07-30.md
Last active January 10, 2016 09:38
[15w31a] ダメージ値によるアイテムのモデルの変更について

ダメージ値によるアイテムのモデルの変更について

基本記述例

{
    "parent": "item/handheld",
    "textures": {
        "layer0": "items/gold_axe"
    },
    "overrides": [
        { "predicate": { "damage": 0.0 }, "model": "item/diamond_sword" },
@keepoff07
keepoff07 / getTouchLocation.java
Created July 1, 2015 11:34
[Bukkit] PlayerInteractEventでクリックしたブロックの詳しいLocationを取得する | あるふぁ
Location getTouchLocation(PlayerInteractEvent event) {
Action action = event.getAction();
if(!(action.equals(Action.LEFT_CLICK_BLOCK) || action.equals(Action.RIGHT_CLICK_BLOCK))) return null;
Location O = event.getPlayer().getEyeLocation();
Block block = event.getClickedBlock();
Location P = block.getLocation().subtract(O);
double Yaw = (double)O.getYaw();
if(Yaw > 0) Yaw -= 360;
double AngY = Math.toRadians(Math.abs(Yaw));
double AngP = Math.toRadians(O.getPitch()*-1d);
@polamjag
polamjag / amazon-calc.js
Last active September 7, 2022 11:23 — forked from arcatdmz/amazon-csv.js
Amazon で使った金額の合計を出す奴 (2014-2016 年バージョン)
// Amazon で使った金額の合計を出す奴
//
// 使い方:
// 1. 全部コピーする (右上の Raw をクリックした先でやるのが楽)
// 2. Amazon の注文履歴ページ ( https://www.amazon.co.jp/gp/css/order-history/ ) を開く
// 3. F12 または 右クリ→要素の検証 とかで出てくる開発者ツールのコンソール (JavaScript REPL) にペースト
// 4. エンターで実行
// (Firefox はなんか allow pasting とタイプしろみたいなことを言われるので従う)
// 5. しばらく待つと alert で合計金額を表示
//
@tigawa
tigawa / csv.js
Created February 7, 2014 06:53
CSVファイルをJavaScriptから読込み方法 (ファイルを指定すると、2次元配列で結果はを返す。)
function csv2Array(filePath) { //csvファイルノ相対パスor絶対パス
var csvData = new Array();
var data = new XMLHttpRequest();
data.open("GET", filePath, false); //true:非同期,false:同期
data.send(null);
var LF = String.fromCharCode(10); //改行コード
var lines = data.responseText.split(LF);
for (var i = 0; i < lines.length;++i) {
var cells = lines[i].split(",");
@fnando
fnando / dev.conf
Created July 23, 2011 09:00
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;