Skip to content

Instantly share code, notes, and snippets.

View guchimon99's full-sized avatar
🇬🇷
まだ、洞窟で消耗してるの?

guchimon99 guchimon99

🇬🇷
まだ、洞窟で消耗してるの?
View GitHub Profile
void pillar (float r, float h) {
push();
rotateX(HALF_PI);
circle(0, 0, r);
pop();
push();
translate(0, h, 0);
rotateX(HALF_PI);
circle(0, 0, r);
@guchimon99
guchimon99 / main.js
Created February 25, 2020 13:14
Yahoo!ショッピングの商品登録時のバリエーションのサブコードの生成
const baseCode = 'code'
const options = [
{
label: 'カラー',
code: 'c',
items: [
{label: 'ブラック', code: 'black'},
{label: 'ホワイト', code: 'white'},
{label: 'ベージュ', code: 'beige'},
@guchimon99
guchimon99 / halloween.js
Last active October 31, 2019 12:48
halloween.js
function trick () {
if(Math.random() > 0.8) {
return
}
return Array.from({length:999}).map(function(){ return "💩"}).join("")
}
function treat () {
return "🍬"
}
@guchimon99
guchimon99 / index.html
Created June 7, 2019 12:31
点が円の中で動き回るやつ。
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>world</title>
<style>
body {
margin: 0;
position: absolute;
@guchimon99
guchimon99 / トイレットペーパー.js
Created January 29, 2019 07:53
トイレットペーパーを甲とし、甲を逆向きに設置する者を乙、乙の設置した甲を正す者を丙、丙が正した甲を使用する者を丁としたとき、丁が甲を利用することが明確になった時点で、乙は丙に対する報酬の義務を負うが、丁が甲を利用することが明確になる前に乙が丙になった場合はこれを無いものとする。
function 人(名前){
this.名前 = 名前
this.支払い義務 = null
}
function 支払い義務 (支払先, 額) {
this.支払先 = 支払先
this.額 = 額
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(() => resolve(), ms))
}
function getOldestMessageTimestamp() {
var d = (document.querySelector('.im_message_date_split_text')||{}).innerText
if (!d) {
var date = new Date()
d = date.getFullYear() + '/' + (date.getMonth()+1) + '/' + date.getDate()
}
@guchimon99
guchimon99 / zaif-distributed-orders.js
Last active March 28, 2018 10:46
zaif で 指値めんどくさいときに使うコード
var token = $("form input[name=\"token\"]").val() // DOMからtokenを取得
var amount = 0.0044 // 任意の数量を入れる
var priceBase = 890000 // 基準となる指値
var priceDef = 3330 // 指値の基準からの価格差
var limitBase = null // 逆指値の基準
var limitDef = 0 // 逆指値の基準からの価格差
var range = 10 // 指値の数
var currencyPair = "btc_jpy" // 銘柄
var action = "ask" // 取引内容: "bid" 買い / "ask" 売り
@guchimon99
guchimon99 / get-puttable-inexes.js
Last active February 28, 2018 06:10
リバーシの開いているセルを探す
function moveIndex (index, x, y) {
index += x
index += y * 8
return index
}
function isTopSide (index) {
return index < 8
}
@guchimon99
guchimon99 / zaif-tradeHistoryCsv.js
Created January 5, 2018 06:34
Zaifの取引履歴のCSVのダウンロード
const fs = require('fs'),
Zaif = require('zaif'),
moment = require('moment')
const output = './trade.csv'
const key = "****",
secret = "****"
const zaif = new Zaif(key, secret)
@guchimon99
guchimon99 / convert-profit-coincheck.js
Created December 1, 2017 03:54
利益計算用取引所別スクリプト coincheck
var fs = require('fs')
const
PATH_SELLS = __dirname + "/../files/coincehck/buys-2017-11-30.csv",
PATH_BUYS = __dirname + "/../files/coincehck/sells-2017-11-30.csv"
var sellsCsv = fs.readFileSync(PATH_SELLS, 'utf-8'),
buysCsv = fs.readFileSync(PATH_BUYS, 'utf-8')
var result = {}