Skip to content

Instantly share code, notes, and snippets.

View lo48576's full-sized avatar
✔️
activated

YOSHIOKA Takuma lo48576

✔️
activated
View GitHub Profile
@lo48576
lo48576 / macroli.h
Last active June 27, 2017 09:35
macroli
/*
* Copyright 2015-2017 YOSHIOKA Takuma
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@lo48576
lo48576 / lolipri.cpp
Last active June 27, 2017 10:14
loligger printer
/*
* Copyright 2014-2017 YOSHIOKA Takuma
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@lo48576
lo48576 / date.vim
Last active September 26, 2015 14:39
" see http://linuxjm.osdn.jp/html/LDP_man-pages/man3/strftime.3.html
:nnoremap <F5> "=strftime("%Y/%m/%d %H:%M:%S")<CR>P
:inoremap <F5> <C-R>=strftime("%Y/%m/%d %H:%M:%S")<CR>
@lo48576
lo48576 / hierarchial-tag.rb
Last active November 2, 2015 08:47
階層化されるタグをjekyllで実現するためのプラグイン。 `_plugins` ディレクトリに入れればおkなはず。 http://l1048576.github.io/blog/2015/03/01/new-blog.html
module Jekyll
class HierarchialTag
def self.decompose_path(path)
path.split('/').take_while{|frag|
# 潜在的な危険性のある文字列を発見したら、そのパスについては
# 危険な文字列以降を捨てる。
# (たとえば'a/b/../c'であれば'a/b'までが使われる)。
# 空文字列でない
!frag.empty? &&
# '..'でない
@lo48576
lo48576 / container_10-host0.network
Last active November 7, 2015 11:13
なんかうまくいかない
[Match]
Name=host0
[Network]
#IPForward=yes
DNS=8.8.8.8
Address=172.16.0.2/24
Gateway=172.16.0.1
[Address]
@lo48576
lo48576 / asciidoctor-enviroment.md
Last active December 3, 2015 09:44
asciidoctor environment at 2015-12-03
$ ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]

$ gem -v
2.4.8

$ asciidoctor -v
Asciidoctor 1.5.3 [http://asciidoctor.org]
Runtime Environment (ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]) (lc:UTF-8 fs:UTF-8 in:- ex:UTF-8)
@lo48576
lo48576 / init.vim
Last active January 23, 2016 10:44
NeoBundle (2016/01/23 19:18, commit 7597065) で発生する問題の再現
" how to reproduce problem:
" 1. `:SCCompile`
" (message "SingleCompile: Current buffer's filetype is not specified." printed.)
" 2. `:SCCompileRun` right after it.
" (shown messages are below:)
" Error detected while processing function neobundle#autoload#_command:
" line 17:
" E464: Ambiguous use of user-defined command: SCCompileRun
@lo48576
lo48576 / dedup_paren.vim
Last active January 27, 2016 06:31
ignore input for duplicate closing paren/brace/brackets.
function! InsDedupParen(closer)
let cur_ch = getline('.')[col('.')-1]
let parenRList = ["}", ")", "]", "\"", "\'"]
let paren_index = index(parenRList, cur_ch)
if paren_index >= 0 && parenRList[paren_index] == a:closer
return "\<C-O>a"
endif
return a:closer
endfunction
@lo48576
lo48576 / 20160620_sfcdetails_partial.txt
Created June 20, 2016 05:25
Linux hostのVirtualBox内でのWindows10ゲストでDirectX関連エラーが出る件
...
2016-06-20 13:31:37, Info CSI 000014b1 [SR] Beginning Verify and Repair transaction
2016-06-20 13:31:39, Info CSI 000014b3 [SR] Cannot repair member file [l:8]"d3d9.dll" of Microsoft-Windows-DirectX-Direct3D9, version 10.0.10586.0, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35} in the store, hash mismatch
2016-06-20 13:31:41, Info CSI 000014b9 [SR] Cannot repair member file [l:8]"d3d9.dll" of Microsoft-Windows-DirectX-Direct3D9, version 10.0.10586.0, arch amd64, nonSxS, pkt {l:8 b:31bf3856ad364e35} in the store, hash mismatch
2016-06-20 13:31:41, Info CSI 000014ba [SR] This component was referenced by [l:169]"Microsoft-Windows-Client-Features-Package-AutoMerged-windows~31bf3856ad364e35~amd64~~10.0.10586.0.Microsoft-Windows-Client-Features-Package-AutoMerged-windows-Deployment"
2016-06-20 13:31:41, Info CSI 000014bd [SR] Could not reproject corrupted file [l:23 ml:24]"\??\C:\WINDOWS\System32"\[l:8]"d3d9.d
@lo48576
lo48576 / rrysnc.sh
Last active August 6, 2018 04:49
[unmaintained, NOT SAFE] rrsync replacement without perl, useful for limited environment like CoreOS
#!/bin/sh
# Copyright (C) 2004 Joe Smith <js-cgi@inwap.com>
# Copyright (C) 2004-2015 Wayne Davison <wayned@samba.org>
# Copyright (C) 2016-2018 YOSHIOKA Takuma <tashioka.256@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.