Skip to content

Instantly share code, notes, and snippets.

View kuboon's full-sized avatar
Working from home

Ohkubo KOHEI kuboon

Working from home
View GitHub Profile
kuboon / gist:50495
Created January 22, 2009 10:39
@file 現在のOSのProxy設定を読み取る
#include "StdAfx.h"
#include <Winhttp.h>
#pragma comment(lib, "Winhttp.lib")
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
kuboon / jforty.html
Created June 15, 2012 06:53
Forth for control jQuery
<title>jQuery forth test</title>
<link rel="stylesheet" href="" type="text/css" media="all" />
<link rel="stylesheet" href="" type="text/css" media="all" />
<script src="" type="text/javascript"></script>
<script src="" type="text/javascript"></script>
<script src="" type="text/javascript"></script>
kuboon / application_helper.rb
Created July 26, 2012 08:15
glyph icon helper for twitter-bootstrap with Rails
module ApplicationHelper
# ==== Examples
# glyph(:share_alt)
# # => <i class="icon-share-alt"></i>
# glyph(:lock, :white)
# # => <i class="icon-lock icon-white"></i>
def glyph(*names)
content_tag :i, nil, class:{|name| "icon-#{name.to_s.gsub('_','-')}" }
kuboon / send_file_with_utf8.rb
Last active December 16, 2015 20:39
allow you to send_file with multibyte filename
wget -P config/initializers/
kuboon / solr.cap
Created September 9, 2014 05:12
put in lib/capistrano/tasks
namespace :solr do
def args
fetch(:sunspot_args, "")
def sunspot_roles
fetch(:sunspot_server_role, :app)
desc "start solr"
kuboon / gist:e5c779833e7b8dc405ed
Last active August 29, 2015 14:09
人狼アリーナ API

POST /villages





module ApplicationHelper
def omit(val = nil, &block)
unless block_given?
raise 'no parent block' if @_omit.empty?
@_omit[-1] = false unless val.nil?
return val
raise "Don't pass a value with block" if val
@_omit ||= []
kuboon / generator.rb
Last active August 29, 2015 14:14
Ruby/Rails supported versions matrix
# gem install octokit
require 'octokit'
require 'yaml'
TARGET = 'rails/rails'
def main
md_table 'rails',{|k,v| v}.to_h
def md_table(name, hash)
kuboon / edge_back.html
Last active September 10, 2015 01:44
Avoid the behavior that Edge browser does not persist checkbox and radio state on history.back()
<input type="hidden" id="edge_back_data_store" />
<script type="text/javascript">
var edge_ver = function(){
var match = navigator.userAgent.match(new RegExp('Edge/(.+)'));
return match ? parseFloat(match[1]) : 999
if(12.1024 < edge_ver()) return;
var data_store = document.getElementById('edge_back_data_store');