Skip to content

Instantly share code, notes, and snippets.

Avatar

Yoshihide Jimbo jmblog

View GitHub Profile
View navbar.haml
%nav.navbar.navbar-inverse{:role => "navigation"}
.container
.navbar-header
%button.navbar-toggle{:type => "button", "data-toggle" => "collapse", "data-target" => ".navbar-gnav-collapse"}
%span.sr-only Toggle navigation
%span.icon-bar
%span.icon-bar
%span.icon-bar
.collapse.navbar-collapse.navbar-gnav-collapse
%ul.nav.navbar-nav
@jmblog
jmblog / gist:6077993
Last active Feb 16, 2021
所得税と住民税の計算方法
View gist:6077993

所得税(国税)

所得税の計算方法

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

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

所得税の税率

@jmblog
jmblog / gist:6077992
Created Jul 25, 2013
Income Tax in Japan
View gist:6077992

Income Tax in Japan

Individual income tax in Japan consists of national income tax(所得税) and local inhabitant tax(住民税). Inhabitant tax is assessed by the prefectural and municipal governments.

Ordinary income consists of the following:

  • interest income(利子所得)
  • dividend income(配当所得)
  • real estate income(不動産所得)
  • business income(事業所得)
  • employment income(給与所得)
@jmblog
jmblog / gist:4499467
Last active Dec 10, 2015
perlbrewで入れたPerlをcronで実行する方法。bash の l オプションをつけるだけでよさげ。
View gist:4499467
* * * * * bash -lc 'perl -v > $HOME/perl-env.log 2>&1'
@jmblog
jmblog / heart_shape.scss
Created Aug 21, 2012
Sass mixin for CSS Heart Shape
View heart_shape.scss
// border-radius(), transform() and transform-origin() mixins are from Compass.
// http://compass-style.org/
@mixin heart($width: 50px, $color: hotpink) {
$half: ($width / 2);
$height: ($half * 1.6);
display: inline-block;
position: relative;
width: $width;
@jmblog
jmblog / gist:3269147
Created Aug 6, 2012
$.Deferred を使って遅延実行
View gist:3269147
// 参考
// http://tokkono.cute.coocan.jp/blog/slow/index.php/programming/how-happy-with-jquery-deferred-for-your-applications/
(function($) {
$.timeout = function(time) {
return $.Deferred(function(dfd) {
setTimeout(dfd.resolve, time);
}).promise();
};
for (var i = 0; i < 5; i++) {
@jmblog
jmblog / gist:3222899
Created Aug 1, 2012
Simple HTML encoding/decoding using jQuery
View gist:3222899
// http://stackoverflow.com/questions/1219860/javascript-jquery-html-encoding
function htmlEncode(value){
return $('<div/>').text(value).html();
}
function htmlDecode(value){
return $('<div/>').html(value).text();
}
@jmblog
jmblog / gist:3128471
Created Jul 17, 2012
FQL: Count comments from a specified user on a facebook page
View gist:3128471
select '' from comment where post_id in (select post_id from stream where source_id = FB_PAGE_ID) and fromid = FB_USER_ID
@jmblog
jmblog / test1.js
Created Jun 1, 2012
Examples of shim config in RequireJS 2.0 - Backbone and underscore
View test1.js
require.config({
paths: {
underscore: '../underscore-min'
},
shim: {
underscore: {
exports: function() {
return _.noConflict();
}
}
@jmblog
jmblog / gist:1188292
Created Sep 2, 2011
Check z-index in IE6/7
View gist:1188292
$('*').each(function() {
var position = $(this).css('position'),
zIndex = $(this).css('z-index');
if (position != 'static' && zIndex != 'auto') {
console.log(position, zIndex, $(this));
} else if (position != 'static') {
console.log(position, '0 in IE', $(this));
}
});