Skip to content

Instantly share code, notes, and snippets.

@jmblog
jmblog / test1.js
Created June 1, 2012 04:31
Examples of shim config in RequireJS 2.0 - Backbone and underscore
require.config({
paths: {
underscore: '../underscore-min'
},
shim: {
underscore: {
exports: function() {
return _.noConflict();
}
}
@jmblog
jmblog / gist:3128471
Created July 17, 2012 09:54
FQL: Count comments from a specified user on a facebook page
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 / gist:3269147
Created August 6, 2012 02:12
$.Deferred を使って遅延実行
// 参考
// 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:4499467
Last active December 10, 2015 22:08
perlbrewで入れたPerlをcronで実行する方法。bash の l オプションをつけるだけでよさげ。
* * * * * bash -lc 'perl -v > $HOME/perl-env.log 2>&1'
@jmblog
jmblog / gist:6077992
Created July 25, 2013 08:52
Income Tax in Japan

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(給与所得)
%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 / 960gs.scss
Created May 18, 2011 06:57
960gs.scss
/*-----------------------------------------------------
960 Grid System ~ Core CSS.
Learn more ~ http://960.gs/
Licensed under GPL and MIT.
-------------------------------------------------------*/
/* Grid Settings
---------------------------*/
// 12-column grid
@jmblog
jmblog / file0.txt
Last active November 7, 2016 00:46
CI のビルド時に patch を適用する際の注意点 ref: http://qiita.com/jimbo/items/1643523195b03f53e860
# 1回目
$ patch --batch -p0 -i xxx.patch
patching file node_modules/foo/bar/xxx
# 2回目
$ patch --batch -p0 -i xxx.patch
patching file node_modules/foo/bar/xxx
Reversed (or previously applied) patch detected! Assuming -R. # 元に戻ってしまう
@jmblog
jmblog / heart_shape.scss
Created August 21, 2012 05:40
Sass mixin for CSS Heart Shape
// 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 / .editorconfig
Created December 28, 2016 01:16
My .editorconfig
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
trim_trailing_whitespace = true