Skip to content

Instantly share code, notes, and snippets.

View castor4bit's full-sized avatar

Toru Okugawa (Tanaka) castor4bit

View GitHub Profile
--- autoload/lexima/insmode.vim 2020-01-01 04:36:47.000000000 +0900
+++ autoload.fixed/lexima/insmode.vim 2020-01-01 04:37:49.000000000 +0900
@@ -81,7 +81,7 @@
" Define imap in the last of the function in order to avoid invalid mapping
" definition when an error occur.
if newchar_flg
- if has('nvim') && a:rule.char == '<CR>' && g:lexima_nvim_accept_pum_with_enter
+ if a:rule.char == '<CR>' && g:lexima_nvim_accept_pum_with_enter
execute printf("inoremap <expr><silent> %s pumvisible() ? \"\\<C-y>\" : lexima#expand(%s, 'i')",
\ a:rule.char,
@castor4bit
castor4bit / CVE-2015-4024-php5.2.17.patch
Last active August 29, 2015 14:23
CVE-2015-4024.patch (PHP5.2/5.3) ** Use at your own risk. **
--- ../php-5.2.17/main/rfc1867.c 2010-03-18 18:37:25.000000000 -0400
+++ main/rfc1867.c 2015-06-18 22:06:43.613999937 -0400
@@ -34,6 +34,7 @@
#include "rfc1867.h"
#include "php_ini.h"
#include "ext/standard/php_string.h"
+#include "ext/standard/php_smart_str.h"
#define DEBUG_FILE_UPLOAD ZEND_DEBUG
@castor4bit
castor4bit / sakura_vps_2gb.md
Last active August 29, 2015 14:20
UnixBench

Sakura VPS

  • CPU: (Virtual) 3 Core
  • Memory: 2GB
  • Storage: HDD 200GB
  • CentOS 6 x86_64
UnixBench
make all
make[1]: Entering directory `/tmp/UnixBench'
@castor4bit
castor4bit / index.html
Last active August 29, 2015 14:07
jQuery Performance Issue in IE8
<!doctype html>
<html>
<head>
<title>test</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
jQuery(function($) {
// mouse event
var box = document.getElementById("box");
var outer = document.getElementById("outer");
@castor4bit
castor4bit / SyckModuleTest.php
Created June 16, 2013 07:44
Spyc tests with syck module.
<?php
require_once ("../Spyc.php");
class SyckModuleTest extends PHPUnit_Framework_TestCase {
public function testLoad() {
$spyc = new Spyc();
$data = file_get_contents('./example.yaml');
@castor4bit
castor4bit / generate_dummydata.rb
Created March 20, 2013 20:18
MySQL5.6.10でのSTART TRANSACTION READ ONLY効果検証
require 'faker'
require 'date'
now = Time.now
100000.times do |i|
line = [
i+1,
Faker::Name.name,
Faker::Internet.email,
Faker::PhoneNumber.phone_number,
@castor4bit
castor4bit / automator_open_shared_directory.rb
Last active December 14, 2015 11:08
Automatorで選択範囲の共有ディレクトリパスを開く
ARGF.each do |path|
path.force_encoding("UTF-8") unless path.nil?
if path =~ /^\\/
path.gsub!(%r|^\\\\|, "smb://").gsub!(%r|\\|, "/")
end
system("open #{path}")
end
@castor4bit
castor4bit / automator_convert_path.rb
Last active December 14, 2015 11:09
Automatorで選択範囲の共有ディレクトリパスを、Windows/Macそれぞれに変換して出力
ARGF.each do |path|
path.force_encoding("UTF-8") unless path.nil?
puts path
if path =~ /^smb:/
puts path.gsub(%r|^smb://|, "\\\\\\").gsub(%r|/|, "\\")
else
puts "smb:#{path.gsub("\\", "/")}"
end
end
@castor4bit
castor4bit / cybozu.user.js
Created November 22, 2012 07:02
CybouzuAutoLogon
// ==UserScript==
// @name CybouzuAutoLogon
// @namespace http://cbz.example.co.jp/
// @include http://cbz.example.co.jp/cgi-bin/ag.cgi
// @include http://cbz.example.co.jp/cgi-bin/ag.cgi?page=AGIndex
// ==/UserScript==
(function() {
var member_id = 00000;
var member_name = 'member_name';
var check = 0;
@castor4bit
castor4bit / vim.rb
Created July 16, 2012 03:54 — forked from mugijiru/vim.rb
Homebrew Formula for vim+ruby
require 'formula'
class Vim < Formula
# url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' url 'https://vim.googlecode.com/hg/', :tag => 'v7-3-600' version '7.3.600'
homepage 'http://www.vim.org/'
# md5 '5b9510a17074e2b37d8bb38ae09edbf2'
head 'https://vim.googlecode.com/hg/'
# depends_on 'cmake' => :build