Skip to content

Instantly share code, notes, and snippets.


Yoshihide Jimbo jmblog

View GitHub Profile
jmblog / gist:6077993
Last active Feb 28, 2021
View gist:6077993



所得税額 = (所得金額(A) - 所得控除額(B)) × 税率 - 税額控除額(C)

  • 「所得金額(A)- 所得控除額(B)」は 課税所得金額 といい、1,000円未満の端数を切り捨てる。


View useDetectOutsideClick.ts
import { useState, useEffect, RefObject } from 'react';
export const useDetectOutsideClick = (ref: RefObject<HTMLElement>, initialState: boolean) => {
const [isActive, setIsActive] = useState(initialState);
useEffect(() => {
const pageClickEvent = (event: MouseEvent) => {
// If the active element exists and is clicked outside of
if (ref.current !== null && !ref.current.contains( as Node)) {
jmblog / bash_prompt
Created May 23, 2014
Bash prompt customization
View bash_prompt
#!/usr/bin/env bash
# Check that terminfo exists before changing TERM var to xterm-256color
# Prevents prompt flashing in Mac OS X 10.6
if [ -e /usr/share/terminfo/x/xterm-256color ]; then
export TERM='xterm-256color'
# Turn off standout; turn off underline
tput sgr 0 0
View nuxt-netlify-http2-server-push-module.js
const debug = require('debug')('nuxt:netlify-http2-server-push');
const path = require('path');
const glob = require('glob');
const fs = require('fs');
module.exports = function module(moduleOptions) {
// This module is only enabled on production builds
if ( {
jmblog / gist:3222899
Created Aug 1, 2012
Simple HTML encoding/decoding using jQuery
View gist:3222899
function htmlEncode(value){
return $('<div/>').text(value).html();
function htmlDecode(value){
return $('<div/>').html(value).text();
jmblog / file0.txt
Last active Dec 5, 2017
Vanilla JS や TypeScript で Custom Elements を書く際の注意点 ref:
View file0.txt
Failed to construct 'HTMLElement': Please use the 'new' operator, this DOM object constructor cannot be called as a function.
jmblog / karabiner.json
Last active Nov 12, 2017
かなキーで「英数/かな」のトグル切り替え(Karabiner-Elements 11.1.8以上が必要)
View karabiner.json
"profiles": [
"complex_modifications": {
"rules": [
"description": "Toggle input source (English or Japanese) by kana key (available since Karabiner-Elements 11.1.8)",
"manipulators": [
"conditions": [
View yui-fonts.scss
/* YUI Fonts.css
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:
version: 3.3.0
build: 3167
body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}select,input,button,textarea{font:99% arial,helvetica,clean,sans-serif;}table{font-size:inherit;font:100%;}pre,code,kbd,samp,tt{font-family:monospace;*font-size:108%;line-height:100%;}
@mixin font_10 { font-size: 77%; }
View navbar.slim
nav class="nav navbar navbar-inverse" role="navigation"
div class="container"
div class="navbar-header"
button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-gnav-collapse"
span class="sr-only" Toggle navigation
span class="icon-bar"
span class="icon-bar"
span class="icon-bar"
div class="collapse navbar-collapse navbar-gnav-collapse"
ul class="nav navbar-nav"
View tsconfig.json
"compilerOptions": {
"outDir": "./dist/",
"sourceMap": true,
"noImplicitAny": true,
"strictNullChecks": true,
"removeComments": true,
"module": "commonjs",
"target": "es5",
"jsx": "react"