Skip to content

Instantly share code, notes, and snippets.

View hirayama-evolni's full-sized avatar

hirayama-evolni

View GitHub Profile
@hirayama-evolni
hirayama-evolni / min.js
Last active March 6, 2018 11:32
A bookmarklet for check the HTML with html-inspector( https://github.com/philipwalton/html-inspector ). Caution: May not work on all browsers for security restrictions.
void function(t){if(t.HTMLInspector!=null){t.HTMLInspector.inspect()}else{var e=document.getElementsByTagName("head")[0]||document.documentElement;var n=document.createElement("script");n.type="text/javascript";n.src="https://rawgithub.com/philipwalton/html-inspector/master/dist/html-inspector.js";n.onload=function(){t.HTMLInspector.inspect()};e.appendChild(n)}}(window);
@hirayama-evolni
hirayama-evolni / Vagrantfile
Last active August 29, 2015 14:02
centos 6.5で、shellでhttpdを入れるVagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
PROVISION_SHELL_SCRIPT = <<SCRIPT
yum install -y httpd php
/sbin/chkconfig httpd on
echo "EnableSendfile off" >> /etc/httpd/conf/httpd.conf
@hirayama-evolni
hirayama-evolni / gist:828ac8f4f69ac884feae
Created June 17, 2014 04:06
fancybox-1.3.4を新しめのjQuery&Migrateと使う時にinlineで出してるところが消える現象の回避方法
$(function(){
// 上位の(オリジナルの)関数
var orig_func = jQuery.event.trigger;
// 上書きする
jQuery.event.trigger = function(event, data, elem, onlyHandlers){
/*** fancyboxからの呼び出しを特別扱いする ***/
if(/^fancybox-/.test(event)){
// 全要素に対してeventを発火する(fancyboxが期待している動作)
var el = $("body *"), ret;
@hirayama-evolni
hirayama-evolni / gist:3278246d7fc097fff9f7
Created July 2, 2014 09:08
TortoiseHgで、ファイルを既定のアプリで開く設定例
[editor-tools]
start.executable = cmd
start.args = /C start "" $FILE
[editor-patterns]
**.gif = start
**.jpg = start
**.png = start
@hirayama-evolni
hirayama-evolni / test.php
Last active August 29, 2015 14:03
PHPで日本語メール
<?php
$subject = "てすと";
$body = <<<END
ほんぶん1
ほんぶん2
ほんぶん3
ほんぶん4
ほんぶん5
@hirayama-evolni
hirayama-evolni / gist:f2afc102afc57745ff7b
Created September 17, 2014 05:53
Laravelで、cssとjsをbladeに通す
// cssとjs
function tmptmp_proc_assets($path, $is_css)
{
if ($is_css) {
// css
$content_type = 'text/css';
} else {
// js
$content_type = 'text/javascript';
}
name="IE9 - Win7"
groups="/"
ostype="Windows 7 (32 bit)"
UUID="a422b326-ca31-4d5f-8acd-2e1f47644f55"
CfgFile="C:\\Users\\hirayama\\VirtualBox VMs\\IE9 - Win7\\IE9 - Win7.vbox"
SnapFldr="C:\\Users\\hirayama\\VirtualBox VMs\\IE9 - Win7\\Snapshots"
LogFldr="C:\\Users\\hirayama\\VirtualBox VMs\\IE9 - Win7\\Logs"
hardwareuuid="a422b326-ca31-4d5f-8acd-2e1f47644f55"
memory=512
pagefusion="off"
C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/driver/base.rb:387:in `gsub': invalid byte sequence in UTF-8 (ArgumentError)
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/driver/base.rb:387:in `execute'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/driver/version_4_3.rb:251:in `read_forwarded_ports'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/driver/version_4_3.rb:456:in `block in read_used_ports'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/driver/version_4_3.rb:449:in `each'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/driver/version_4_3.rb:449:in `read_used_ports'
from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.1/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:12:in `call'
@hirayama-evolni
hirayama-evolni / zipsearch.php
Last active August 29, 2015 14:23
郵便番号検索ライブラリ
<?php
/*
* 郵便番号検索ライブラリ
* (C) EVOLNI
* (C) Wataru Hirayama
* License: MIT
*
* Version: 1.0.0
*
@hirayama-evolni
hirayama-evolni / rsync_backup.md
Last active August 29, 2015 14:26
rsyncのバックアップオプションのテスト

jQueryのgitリポジトリで実験

$ mkdir ../backup_test
$ git checkout 1.8.0
$ rsync -v -a --exclude=node_modules --exclude=.git . ../backup_test/current
$ find ../backup_test/current/|sort > ../a
$ git checkout 1.8.1
# -bのみ … 同じ場所に~がついてバックアップされる
$ rsync -b -a --exclude=node_modules --exclude=.git . ../backup_test/current
$ find ../backup_test/current/|sort > ../b