Skip to content

Instantly share code, notes, and snippets.

View potato4d's full-sized avatar
💭
It's not so easy to be consistent

Takuma HANATANI potato4d

💭
It's not so easy to be consistent
View GitHub Profile
@potato4d
potato4d / file2.txt
Last active October 23, 2019 13:16
Firebaseを用いて5分でセキュアなWebサイトを公開する ref: https://qiita.com/potato4d/items/95eaf2e41404711e621e
$ firebase init
You're about to initialize a Firebase project in this directory:
/path/to/project-dir
? What Firebase CLI features do you want to setup for this folder? (Press <space> to select)
◯ Database: Deploy Firebase Realtime Database Rules
❯◉ Hosting: Configure and deploy Firebase Hosting sites
@potato4d
potato4d / formData
Last active December 20, 2018 01:27
Botkitを利用してSlack上の発言からGitHubのIssueを作成するBotを作る ref: https://qiita.com/potato4d/items/81e9e8aef6cd57c234af
{
"title": "Issueの題名",
"body" : "IssueのDesciption"
}
@potato4d
potato4d / gulpfile.js
Last active December 20, 2018 01:25
Gulpを用いてサクッとS3に静的Webサイトをデプロイする ref: https://qiita.com/potato4d/items/c0248b6b216d2a32bbba
var s3 = require("gulp-s3-upload")(require("./iam.json"));
var
gulp.task("deploy2s3", function(){
return gulp.src([]) // デプロイ時にアップロードしたいファイル群
.pipe(s3({
Bucket: "バケット名",
ACL: "public-read"
}))
@potato4d
potato4d / style.scss
Last active December 20, 2018 01:25
CSSで画像の四隅に三角をつけてイイカンジの枠組みっぽくする ref: https://qiita.com/potato4d/items/b31aefb7114ed9b348ea
.image{
overflow:hidden;
// 残りのコード
}
@potato4d
potato4d / calender.html
Created February 1, 2016 05:44
カレンダーの画像作る奴。holidayを変えたら色が変わり、右クリで保存が可能
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>CalendarMaker</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.4.21/p5.min.js"></script>
<script src="sketch.js"></script>
</head>
<body>
</body>
@potato4d
potato4d / d_and_d_and_manual.php
Created January 25, 2016 05:30
D&Dとファイル選択が可能な、 https://gist.github.com/potato4d/9215eb2645eecc2117a1 の強化版
<?php
$uploaddir = __DIR__."/";
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
// バージョン依存問題の解消
if(function_exists("http_response_code")){
http_response_code(200);
}else{
header('HTTP', true, 200);
}
@potato4d
potato4d / index.html
Created January 18, 2016 02:15
underscore.jsの機能使ってごにょごにょ。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>underscore.js sample</title>
</head>
<body>
<ul id="list">
@potato4d
potato4d / d_and_d_upload.php
Last active January 25, 2016 05:33
同一ディレクトリに両方のファイルを置いてる前提
<?php
$uploaddir = __DIR__."/";
$uploadfile = $uploaddir . basename($_FILES['file']['name']);
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
// バージョン依存問題の解消
if(function_exists("http_response_code")){
http_response_code(200);
}else{
header('HTTP', true, 200);
}
@potato4d
potato4d / AdventCalender.satoriku.php
Created December 17, 2015 07:06
某某某某某某某某某アドベントカレンダー17日目の記事らしい
<?php
header('Content-Type: text/plain');
echo <<<EOT
この記事は某某某某某某某某某 Advent Calendar 2015の15日目の記事です。遅刻すみません。
こんなんなにを書けっていうんだ……
Twitterのりくサー(?)好きっつーかTwitterの絡みの7割ぐらいになってるから身内ネタ最高って感じです。
そういえば初めはsoft_hat界隈と認識してたんだよね。実は。(初めて見たのがTes.Soなので)
@potato4d
potato4d / app.js
Created August 18, 2015 09:39
Ring Zeroの連携テスト
var express = require('express');
var app = express();
var exec = require('child_process').exec;
var addr = "";
app.get('/', function (req, res) {
res.send("hello, world");
});
app.get('/ring', function (req, res) {