Skip to content

Instantly share code, notes, and snippets.

  • Bearer は「持参人払い」から来ている  ※大辞林によると「持参人払い=小切手などの証書で,特定の者を権利者として指定せず,それを持参した人に支払うこと」
  • つまり、トークンを持ってきた人に対して支払う(API 利用を許可する)、という意味である
  • 例えば、飛行機のチケットは持ってきた人が権利者かどうかの確認を行うが、演劇のチケットは持ってきた人が観劇できる。この演劇のチケットが Bearer である
@hihats
hihats / custom-style.css
Last active November 16, 2017 12:49
Kobito custom css
html{color:#201858;}body,p,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,select,p,blockquote,th,td{margin:0;padding:0}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}address,button,caption,cite,code,dfn,em,input,optgroup,option,select,strong,textarea,th,var{font:inherit}ins{text-decoration:none}li{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal}q:before,q:after{content:''}abbr,acronym{border:0;font-variant:normal}sup{vertical-align:baseline}sub{vertical-align:baseline}legend{color:#000}
/* ------------------------------
* when using emoji
* https://www.webpagefx.com/tools/emoji-cheat-sheet/
* ------------------------------ */
body {
background-color: #201858;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
@hihats
hihats / code.gs
Last active September 23, 2016 03:41
外部サーバのJSから操作するGoogle Apps Script example
function doPost(e) {
var url = 'https://docs.google.com/spreadsheets/d/DQ9*****Be/edit';
var sheet_name = e.parameter.sheet_name;
var ss = SpreadsheetApp.openByUrl(url);
var sheet = getSheetNotExist(ss, sheet_name);
var col = sheet.getLastColumn();
var new_col = parseInt(col) + 1;
var range = sheet.getRange(1, new_col).setValue(new Date());
var values = sheet.getRange(1, 3, 10).getValues();
checkInSheet(sheet, e.parameter, values, new_col);
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@hihats
hihats / prefecture_jp_simple_array.json
Last active August 29, 2015 14:17
単純な一次配列型都道府県JSONデータ
simple_prefs = ["", "北海道", "青森県", "岩手県", "宮城県", "秋田県", "山形県",
"福島県", "茨城県", "栃木県", "群馬県", "埼玉県", "千葉県", "東京都",
"神奈川県", "新潟県", "富山県", "石川県", "福井県", "山梨県", "長野県",
"岐阜県", "静岡県", "愛知県", "三重県", "滋賀県", "京都府", "大阪府",
"兵庫県", "奈良県", "和歌山県", "鳥取県", "島根県", "岡山県", "広島県",
"山口県", "徳島県", "香川県", "愛媛県", "高知県", "福岡県", "佐賀県",
"長崎県", "熊本県", "大分県", "宮崎県", "鹿児島県", "沖縄県"]
#!/bin/bash
echo $@
exit 0
@hihats
hihats / http_status_codes.conf.php
Last active August 29, 2015 14:02
http_status_code setting for php
<?php
/**
* HTTP STATUS CODE
* @author tsukamoto
*/
$http_status_codes = array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing',
200 => 'OK',
@hihats
hihats / dbsize_daily.sh
Last active August 29, 2015 14:01
store trends of database size in file
#!/bin/bash
DB_USER="admin_user"
DB_PASS="***"
DB_NAME="admin"
DB_HOST="192.168.1.11"
TODAY=`date "+%Y%m%d"`
FILE=/var/tmp/dbsize_daily_$TODAY.tsv
ADMIN_MAIL="hishats@gmail.com"
@hihats
hihats / 0_reuse_code.js
Created March 24, 2014 04:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@hihats
hihats / getNextWeekday.php
Last active December 26, 2015 22:59
Get next weekday(not holiday)
<?php
inclulde isHoliday.php
function getNextWeekday($target=NULL){
if($target){
$next_weekday = date('Y-m-d', strtotime($target));
}else{
$next_weekday = date('Y-m-d');
}
$is_holiday = TRUE;