Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Yuki Matsukura matsubo

🏠
Working from home
View GitHub Profile
View gumroad.js
function receiveMessage(a) {
if (!document.getElementById(Gumroad.activeIframeId)) return;
if (document.getElementById(Gumroad.activeIframeId).getAttribute("src").indexOf(a.origin) != "0") return;
var b = a.data.split(" ")[0];
b == "close" && Gumroad.close()
}
var Gumroad = Gumroad || {
urlBlackList: ["/signup", "/login", "/logout", "/admin", "/settings", "/library", "/filtered_customer_count", "/customers", "/customers_switch_product", "/purchases", "/users", "/demo", "/products", "/dashboard", "/analytics", "/balance", "/confirm", "/crossdomain", "/api", "/developers", "/ping", "/webhooks", "/revenue_share", "/jobs", "/team", "/press", "/terms", "/privacy", "/blog-posts", "/faq", "/about", "/about", "/how-it-works", "/overlay", "/embed", "/modal", "/button", "/next-steps", "/charge", "/charge_data", "/CHARGE", "/examplify", "/deck", "/guide"],
init: function () {
if (navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match
View credit_card_bin_codes.md

概要

クレジットカード番号には法則があり、先頭6桁でカードの種類を識別、分類することができる。

詳細はISO/IEC 7812で規定されている。

ISO/IEC 7812 - Wikipedia https://ja.wikipedia.org/wiki/ISO/IEC_7812

先頭の6桁を銀行識別番号(Bank Identification Number、略称:BIN)ないしは発行者識別番号(Issuer Identification Number、略称:IIN)と呼び、この先頭6桁でカード発行会社(イシュア、issuer)が判るようになっている。

@matsubo
matsubo / mapping-mention-to-slack.yml
Created Jan 19, 2021
github mention to slack sample code
View mapping-mention-to-slack.yml
# For Github User
# github_username: "slack_member_id"
# please_replace_me_11: U01G30S9LHW
# please_replace_me_4: U011F5DRG2V
# github_username_A: "slack_member_id_A"
# github_username_B: "slack_member_id_B"
# github_username_C: "slack_member_id_C"
# abeyuya: "XXXXXXXXX"
View mj.html
<!-- wp:heading -->
<h2>概要</h2>
<!-- /wp:heading -->
<!-- wp:image {"id":9874} -->
<figure class="wp-block-image"><img src="https://matsu.teraren.com/blog/wp-content/uploads/2020/01/image-17.png" alt="Jun Murai" class="wp-image-9874"/></figure>
<!-- /wp:image -->
<!-- wp:quote -->
<blockquote class="wp-block-quote"><p>「日本のインターネットの父」と呼ばれる<a href="http://www.asahi.com/topics/word/%E6%85%B6%E5%BF%9C%E5%A4%A7%E5%AD%A6.html">慶応大</a>環境情報学部教授の村井純さん(64)が定年を迎え、16日、最終講義があった。村井さんは「インターネットに国境はない。国や政府が分断したり規制しようとしたりする試みは続くだろうが、若い人たちで守ってほしい」と呼びかけた。</p><cite><a href="https://www.asahi.com/articles/ASN1J6FPYN1JULBJ00N.html">https://www.asahi.com/</a></cite></blockquote>
View session-manager-restrict-users.md

Session Managerを利用するときの制限のかけかた

前提

  • Session Managerをデフォルトで使うと sudoが可能なssm-userユーザを使ってログインすることとなる。

sudoさせたくない場合

  • ssm-userとは別のユーザアカウントをログイン先のOS上で作成する
    • sudo権限は付与しない
@matsubo
matsubo / .tigrc
Last active Jul 7, 2021
.tigrc example for black background terminal.
View .tigrc
# Tig default configuration
#
# Please see 'man tigrc' for a complete reference.
# Settings
# --------
# Most of these settings can be toggleable, either via the toggle-*
# actions or via the option menu (bound to `o` by default).
# View settings
@matsubo
matsubo / container.sh
Created May 19, 2021
yarn 2 + webpacker test
View container.sh
gem i rails
curl -sL https://deb.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs
npm install -g yarn
rails new myapp --webpack
cd myapp/
yarn set version berry
yarn install
bin/webpack-dev-server
View autofill.js
$(function() {
// handling bank code
$('#postcode').keyup(function(e){
if (!(48 <= e.keyCode && e.keyCode <= 57)) { // 0 - 9
return;
}
$('#prefecture').val('');
@matsubo
matsubo / 404.html
Last active May 10, 2021
make Ruby on Rails error page fancy!
View 404.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>The page you were looking for doesn't exist (404)</title>
<!-- Latest compiled and minified CSS -->