Skip to content

Instantly share code, notes, and snippets.

View tkdn's full-sized avatar
🏠
Working From Home.

Satoshi Takeda tkdn

🏠
Working From Home.
View GitHub Profile
@tkdn
tkdn / .bashrc
Last active August 29, 2015 14:11
gitで差分ファイルを抽出する(改変) ref: http://qiita.com/tkdn/items/d6980079b950b584a070
function git_diff_archive()
{
dateTime=`date '+%Y%m%d%H%M'`
local diff=""
local h="HEAD"
if [ $# -eq 1 ]; then
if expr "$1" : '[0-9]*' > /dev/null ; then
diff="HEAD HEAD~${1}"
else
@tkdn
tkdn / charge.php
Last active August 29, 2015 14:11
yahoo の FastPay を使ってみた ref: http://qiita.com/tkdn/items/4a9b63309c8ecbde2aca
<?php
require "vendor/autoload.php";
require 'settlement/fastpay.php'; // ここで上のキーとか呼んでる
use FastPay\FastPay;
// エラーフラグとエラーメッセージのための変数
$error_msg = '';
$error_flg = FALSE;
// Fastpay に課金作成をトライ & エラー処理
@tkdn
tkdn / .lftprc
Last active August 29, 2015 14:12
VVVでwordmoveを使う(いまさら) ref: http://qiita.com/tkdn/items/40e257b2effb48f991c6
set ssl:check-hostname no
set ssl:verify-certificate no
@tkdn
tkdn / bad.js
Last active August 29, 2015 14:12
仮想DOMに思いを馳せていたらそもそもブラウザのレンダリングがわかってなかった ref: http://qiita.com/tkdn/items/5be7ee5cc178a62f4f67
$('<div id="foobar"></div>').append('body').hide();
@tkdn
tkdn / Vagranfile
Created January 19, 2015 14:51
Vagrant+Docker してホストOSのWinでもSyncしたい ref: http://qiita.com/tkdn/items/00da52f5545436b055f3
ip = "172.17.8.#{i+100}"
config.vm.network :private_network, type: "dhcp", ip: ip
config.vm.network :public_network, type: "dhcp"
@tkdn
tkdn / file0.txt
Last active August 29, 2015 14:14
boot2dockerで初心者がつまずいたこと(マウント関係とか) ref: http://qiita.com/tkdn/items/6a539b85ced755fd386e
$ docker run -d -p 80:80 \
-v /c/Users/yourname/projects/repo/html:/var/www/html \ # マウントオプションでホストとの共有ディレクトリを指定
--name apache darekano/apache
$ docker exec -it apache bash # コンテナの中に入る
root@7eaf997110d8:/# cd /var/www/html # くどいけど、コンテナの中のここはホスト=ゲストの共有ディレクトリ
root@7eaf997110d8:/var/www/html# ls -al
total 2
drwxrwxrwx 1 1000 staff 4096 Feb 1 13:29 .
drwxr-xr-x 4 root root 4096 Feb 1 13:28 ..
-rwxrwxrwx 1 1000 staff 5667 Nov 5 09:08 .htaccess
@tkdn
tkdn / custom-helper.js
Created February 14, 2015 05:02
Assemble - Handlebars.js でヘルパーからオブジェクトを参照する ref: http://qiita.com/tkdn/items/499d253c0c71ebdaf56b
module.exports.register = function (Handlebars, options, params) {
'use strict';
Handlebars.registerHelper('foo', function(str) {
return str;
});
};
@tkdn
tkdn / index.js
Last active August 29, 2015 14:15
browserify - jqueryの$をスコープの中に閉じ込めたほうがよいのか、他1点 ref: http://qiita.com/tkdn/items/a29db5b0f30e28018952
var $ = require('jquery');
require('jquery.plugin01');
require('jquery.plugin02');
@tkdn
tkdn / file0.js
Last active August 29, 2015 14:16
jQuery その先のUIアニメーション ref: http://qiita.com/tkdn/items/fc8425605bdbcfc3f893
$(function() {
var action = (function(jqObject) {
var content = jqObject.next('.content');
var contentParent = content.parent();
if(contentParent.hasClass('active')){
content.slideUp('250',function(){
contentParent.removeClass('active');
});
} else {
contentParent.addClass('active');
export function prevLocation(state = {
refDomNode: null,
method: null
}, action) {
switch (action.type) {
case LOCATION_CHANGE:
const method = action.payload.action
return Object.assign({},state,{
method: method
})