This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | |
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> | |
<script> | |
$(function(){ | |
var target = $("select#test"); | |
/** 単純に操作不可にする方法 | |
target.change(function() { | |
target.attr("disabled","disabled"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM INFORMATION_SCHEMA.TABLES | |
SELECT * FROM INFORMATION_SCHEMA.COLUMNS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Function nslookup(ip As String) As String | |
Dim wsh, exec, cmd, res As String, i As Integer | |
Dim buf() As String | |
Set wsh = CreateObject("WScript.Shell") | |
cmd = "nslookup " & ip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# recursive call with hash | |
# calcuation procedure define in block of constractor. | |
# this hash return response first, but its key size is limited about 1,000 keys | |
# => occur SystemStackError | |
h = Hash.new{|hash, value| hash[value] = 1 + hash[value -1] + hash[value -2]} | |
h[0] = 1 | |
h[1] = 1 | |
puts h[3] #=> 5 | |
puts h[100] #=> 1146295688027634168201 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function(){ | |
// same class name jQuery object | |
$('div.some_class'); | |
// these reverse indices jQuery object | |
// Once get indexed objects to array, | |
// Then use Array.reverse() to descending order. | |
// At last, convert array object to jQuery object. | |
$($('div.some_class').get().reverse()); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Array#transpose | |
a = [[1,2,3],[4,5,6],[7,8,9]] | |
a.transpose | |
#=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] | |
# same return | |
a[0].zip(*a[1..-1]) | |
#=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo apt-get install gtk2-engines-pixbuf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ gem install -v 1.3.7 rubygems-update | |
$ update_rubygems |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gnome-tweak | |
sudo add-apt-repository ppa:tualatrix/next | |
sudo apt-get update | |
sudo apt-get install ubuntu-tweak | |
# icon set | |
sudo add-apt-repository ppa:tiheum/equinox | |
sudo apt-get update | |
sudo apt-get install faenza-icon-theme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#-*- coding: utf-8 -*- | |
require 'benchmark' | |
# When you convert a jpg image using ImageMagick, | |
# convert command options combination make a big difference in performance. | |
# so i try to do a benchmark test about parameter combination. | |
# | |
# Fastest combination : when given define option with width and height. | |
# Secondary combination : when given define with either width or height, debug option make faster. |